Repository navigation
fix(mobile-web): leave a deleted open session for its nearest neighbor - #3692
Merged
Merged
Conversation
Deleting the session that the chat pane shows kept ChatPage mounted on it. Its host reads then failed, and the queue panel showed "Session workspace is unavailable on this host" until the user picked another session. After a successful delete of the open session, the session list now hands the app shell the nearest surviving row in the same list (next, else previous). With no neighbor the detail pane falls back to the empty home panel. The swap does not add a navigation entry.
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.
Summary
When the session open in the mobile web chat pane is deleted from the session list, switch to the nearest surviving session in the same list. If there is none, show the empty home panel. The chat page no longer stays on the deleted session and shows an error.
Fixes #3679
Type and Areas
Type: bug fix
Areas: mobile web
Motivation / Impact
The screenshot in #3679 is the mobile web host queue panel ("待发送 0 项" / "刷新"), showing
Error: Session workspace is unavailable on this host. The host raises that fromCoreRemoteDialogRuntimeHost::manage_dialog_queuewhen the session no longer exists and has no workspace binding.Root cause:
SessionListPage.handleDeleteremoved the session from the store, the workspace groups, and the cache, but never toldAppthat the open session was gone.AppkeptactiveSessionId, soChatPagestayed mounted and its queue panel kept reading the deleted session.Fix:
services/sessionDeletionNavigation.ts(nearestSurvivingSession). It finds the list that contains the deleted row and returns the next row, or the previous row when the deleted row was last. It does not jump to another workspace.SessionListPagetakes a new optional prop,onActiveSessionDeleted(next | null). It calls the prop after a successful delete of the open session, before cleaning up local state. The list order matches the compact sidebar: the loaded workspace pages or the projected rows, then the flat list.App.handleActiveSessionDeletedswaps the detail pane in place. It adds no history entry and leaves the sidebar as it was. If there is no next session, it clears the active session so theRemoteHomePanelrenders.This matches the desktop Web UI, which also leaves a removed active session rather than keeping it open (
nextActiveSessionId: null). Mobile web goes one step further and picks a neighbor, as the issue requests.Verification
pnpm --dir src/mobile-web run test:session-deletion: 5 passed. The new test covers the next row, the previous row, no cross-workspace jump, the flat-list fallback, and the deletion handoff from the list to the shell.pnpm --dir src/mobile-web run type-check: passes.pnpm --dir src/mobile-web run test:workspace-identity: 36 passed.pnpm run check:repo-hygiene: passes.Reviewer Notes
delete_sessionwire command, the relay, and the host are unchanged. The fix was not exercised against a live paired desktop. Remote workspace, Peer Device Mode, and Detached Dispatch are unaffected.Checklist
src/mobile-web/AGENTS.mdlists the new focused test).