fix(desktop): restore project to sidebar when resuming session from history, show toast on failure#3603
Merged
esengine merged 1 commit intoJun 9, 2026
Conversation
…istory, add toast notification system
Three fixes for resuming sessions from the history panel:
1. OpenProjectTab now calls addProject() and emitProjectTreeChanged(), so
opening a session from a previously removed project automatically restores
it to the sidebar. No more silent switch to the wrong workspace tab.
2. openProjectTab/openGlobalTab no longer swallow exceptions (catch { return
undefined }). Errors propagate to onResumeSession which shows a user-facing
toast instead of silently falling back to the current tab.
3. A reusable ToastProvider + useToast() hook (info/warn/error levels, 2.5s
auto-dismiss, stackable, click-to-dismiss) is introduced. Used here for
session-open failures and available to other contributors for notifications.
8a5c159 to
8b20184
Compare
esengine
approved these changes
Jun 9, 2026
esengine
left a comment
Owner
There was a problem hiding this comment.
Reviewed the diff: the fix is correct, focused, and CI is green. Approving for merge.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug
Bug 1: Sessions from a removed project cannot restore the project back to the sidebar
After removing project B from the sidebar, its sessions still appear in the history panel. Clicking to open one -- B does not come back to the sidebar. The user thinks nothing happened and clicks again -- still nothing.
Root cause: OpenProjectTab never calls addProject() to write the project back into desktop-projects.json, nor does it notify the frontend to refresh the project tree.
Bug 2: Session-open failure silently falls back to the wrong tab
Clicking a session whose project no longer exists -- the history panel closes, and the session appears on the current active tab (an unrelated project A). The user has no idea what happened.
Root cause: openProjectTab and openGlobalTab swallow all exceptions with catch { return undefined }. The caller passes undefined to resumeSession(path, undefined), which falls back to activeTabId -- loading the data onto the wrong tab with zero feedback.
Fix