Skip to content

feat(dashboard): persist subscriptions display mode per context#32

Merged
fdaugan merged 1 commit into
feature/vuejsfrom
norman/subscriptions-display-mode
Jun 15, 2026
Merged

feat(dashboard): persist subscriptions display mode per context#32
fdaugan merged 1 commit into
feature/vuejsfrom
norman/subscriptions-display-mode

Conversation

@Terracosmos

Copy link
Copy Markdown
Collaborator

Context

Implements #30: the cards/list choice of the shared
SubscriptionsPanel was reset on every visit. It is now remembered per
context in localStorage.

Scope decisions

  • One preference per context, keyed ligoj-subview:<key> (home, project),
    so the dashboard and the project detail are independent.
  • Defaults unchanged: cards on the dashboard, list on the project detail.
    Storage only overrides when it holds a valid cards/list value.
  • Backward compatible: a SubscriptionsPanel used without storage-key keeps
    its previous in-memory-only behaviour.

Changes

  • components/SubscriptionsPanel.vue — new storageKey prop; view is read
    from / written to localStorage via a watcher; .sp-grid capped at 3 columns
    (was an auto-fill that reached 4 on wide screens), responsive to 2 then 1.
  • views/HomeView.vuestorage-key="home".
  • views/ProjectDetailView.vuestorage-key="project".
  • __tests__/subscriptions-panel.test.js — new, 5 cases (persist, restore on
    remount, 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) and npm run build pass.

What's not in this PR

  • A pre-existing Failed to resolve component: LjPageHeader console warning in
    HomeView 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.

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.
@Terracosmos Terracosmos requested a review from fdaugan June 15, 2026 13:21
@sonarqubecloud

Copy link
Copy Markdown

@sonarqubecloud

Copy link
Copy Markdown

@fdaugan fdaugan merged commit 602df49 into feature/vuejs Jun 15, 2026
3 of 4 checks passed
@fdaugan fdaugan deleted the norman/subscriptions-display-mode branch June 15, 2026 16:38
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.

2 participants