feat(dashboard): persist subscriptions display mode per context#32
Merged
Conversation
Remember the cards/list choice of the shared subscriptions panel, independently for the dashboard and the project detail, in localStorage (key prefix ligoj-subview:). Defaults stay cards on the dashboard and list on the project detail. Cards mode now uses a 3-column grid, responsive down to 2 then 1 column on narrow widths.
|
|
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.



Context
Implements #30: the cards/list choice of the shared
SubscriptionsPanelwas reset on every visit. It is now remembered percontext in localStorage.
Scope decisions
ligoj-subview:<key>(home,project),so the dashboard and the project detail are independent.
Storage only overrides when it holds a valid
cards/listvalue.SubscriptionsPanelused withoutstorage-keykeepsits previous in-memory-only behaviour.
Changes
components/SubscriptionsPanel.vue— newstorageKeyprop;viewis readfrom / written to localStorage via a watcher;
.sp-gridcapped at 3 columns(was an auto-fill that reached 4 on wide screens), responsive to 2 then 1.
views/HomeView.vue—storage-key="home".views/ProjectDetailView.vue—storage-key="project".__tests__/subscriptions-panel.test.js— new, 5 cases (persist, restore onremount, home/project independence, backward-compat without key, invalid
value falls back to default).
Design rationale
The toggle was already shared between both views; persistence lives in the one
component instead of being duplicated. The grid breakpoints (1100 / 700 px) are
easy to tune if you want a different cutoff.
Runtime test
Built the plugin bundle, installed plugin-ui 1.1.12-SNAPSHOT locally and ran the
host against it. Verified end-to-end in the browser: per-context persistence
across reloads, defaults respected, 3-column cards grid, home and project
choices independent.
npm run test(10 tests) andnpm run buildpass.What's not in this PR
Failed to resolve component: LjPageHeaderconsole warning inHomeView is unrelated to this change and left untouched.
Note
Base is feature/vuejs, so GitHub will not auto-close the issue. Refs
#30 — to be closed manually after merge.
Feedback welcome — it is a single isolated commit and can be reverted cleanly.