Repository navigation
fix(dashboard): preserve data tab memory when leaving workspace - #10498
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Hey - I've reviewed your changes and they look great!
Sourcery assessment
Needs a human reviewer. If the route metadata is wrong or missing, the change could write an incorrect tab name to localStorage, causing the workspace to reopen on the wrong tab later. Reverting stops future incorrect writes, and the stored preference can be cleared or replaced, so the impact is bounded and repairable.
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.
Leaving a non-Statistics tab overwrites
data_last_tabwithStats, so the Data & Logs sidebar entry forgets the user's selection. For example, Logs → Configuration Files → Data & Logs opens Statistics instead of Logs.The watcher introduced in #10251 observes
activeTab, which falls back tostatisticswhen the destination route has nodataTab. That watcher can run before DataPage unmounts and persist the fallback. Related user feedback: #10377.Modifications
route.meta.dataTabdirectly. The existing tab lookup skips routes outside the workspace, preserving the last valid selection.No documentation or screenshot update is needed: this restores the last-used-tab behavior already documented in
docs/en/use/webui.mdanddocs/zh/use/webui.md; navigation, labels, and layout are unchanged.Test Results
pnpm buildindashboard: passed, includingvue-tsc --noEmitand the production Vite build.ruff format .: 516 files unchanged.ruff check .: passed.git diff --check: passed.Stats !== Consoleafter Logs → Configuration Files. The fixed code passes restoration checks for all four tabs and the legacy conversation route through Configuration Files and Welcome, plus first-visit/invalid-value defaults, query/hash preservation, and a fresh app restoring Logs.Checklist
Summary by Sourcery
Preserve Data & Logs tab selection across workspace navigation by saving only valid route-backed tabs.
Bug Fixes:
Tests: