Skip to content

Show onboarding guidance when no model is loaded on Home view#22

Open
mohityadav8 wants to merge 3 commits intoEAPD-DRB:mainfrom
mohityadav8:feature/empty-state-guidance
Open

Show onboarding guidance when no model is loaded on Home view#22
mohityadav8 wants to merge 3 commits intoEAPD-DRB:mainfrom
mohityadav8:feature/empty-state-guidance

Conversation

@mohityadav8
Copy link

Summary

What changed:
Added a user-friendly onboarding message in the Home view when no model (case) is loaded.

Why:
On first launch, the interface appeared blank or confusing if no case was selected.
This change provides clear guidance to users on what action to take.

Related issues

Issue exists and is linked

Closes #21

Related #21
Validation
Tests added/updated (or not applicable)
Validation steps documented
Evidence attached (logs/screenshots/output as relevant)

Validation steps:
Start backend (python API/app.py)
Open http://localhost:5000
Ensure no osycase exists in localStorage
Confirm that an informational onboarding message appears
Load/select a model → message no longer appears

Documentation
Docs updated in this PR (or not applicable)

Any setup/workflow changes reflected in repo docs
(No documentation changes required — behavior improvement only.)

Scope check
No unrelated refactors
Implemented from a feature branch
Change is deliverable without upstream OSeMOSYS/MUIO dependency
Base repo/branch is EAPD-DRB/MUIOGO:main (not upstream)

image

@mohityadav8
Copy link
Author

@autibet take a look

Copy link
Collaborator

@autibet autibet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Findings

P1: Error masking regression in shared error renderer

In PR #22, Message.isInitialEmptyState treats any message containing "undefined" or "null" as “no case loaded”, and both Message.danger and Message.dangerOsy use it.

These methods are used across many controllers/routes for real failures, so legitimate runtime/backend errors can be replaced with a misleading onboarding notice, hiding the actual problem.

References

  • WebAPP/Classes/Message.Class.js:4
  • WebAPP/Classes/Message.Class.js:54
  • WebAPP/Classes/Message.Class.js:93

P2: Onboarding message logic is not aligned with actual session flow

PR adds onboarding display in Home.onLoad based on localStorage.getItem("osycase") (line 17), but app session state is fetched from backend via Base.getSession(), not localStorage.

Also, the same PR clears messages again in initPage (line 52), which can immediately wipe the onboarding message in the normal load path.

References

  • WebAPP/App/Controller/Home.js:17
  • WebAPP/Classes/Base.Class.js:44
  • WebAPP/App/Controller/Home.js:52

Change summary

PR #22 is small and focused, but the current implementation introduces:

  • A broad error-handling regression
  • A brittle onboarding trigger path

@mohityadav8
Copy link
Author

mohityadav8 commented Mar 6, 2026

@autibet Thanks for the detailed review. I have addressed the issues you pointed out:
P1 – Error masking in Message.Class.js

  • Removed the isInitialEmptyState logic that was modifying error messages.
  • Restored the original behavior of Message.danger() and Message.dangerOsy() so real runtime or backend errors are no longer overridden.
  • Removed the duplicate danger() method and ensured the renderer shows the original "Error!" label.
  • Re-enabled the infoOsy() method so the onboarding message works without affecting the shared error system.

P2 – Onboarding logic and session flow

  • Replaced the localStorage.getItem("osycase") check with Base.getSession() in Home.onLoad() to align with the actual session mechanism used by the application.
  • Removed the additional Message.clearMessages() call from initPage() so the onboarding message is not immediately cleared during normal page initialization.

These changes ensure that:

  • The global error rendering system remains untouched.
  • Onboarding guidance appears only when no case/session is loaded.
  • The message persists during the normal load flow.

Please let me know if any further adjustments are needed.

@mohityadav8 mohityadav8 requested a review from autibet March 6, 2026 05:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replace generic "Error!" message on first load with informative guidance

2 participants