Skip to content

refactor: move the layout store from Vuex to Pinia (CM-1548) - #5001

Merged
gaspergrom merged 1 commit into
mainfrom
refactor/CM-1548-layout-pinia
Oct 16, 2026
Merged

gaspergrom merged 1 commit into
mainfrom
refactor/CM-1548-layout-pinia

Conversation

@gaspergrom

Copy link
Copy Markdown
Contributor

Summary

Moves the layout store from Vuex to a Pinia setup store, useLayoutStore (menuCollapsed and toggleMenu). The menu collapse state, its persistence and the toggle behave as before.

  • isMobile, the window resize listener and collapseMenu are deleted. Nothing read them on main, so this removes one window resize listener.
  • LogRocket no longer records layout/* mutations, because the store is no longer a Vuex module.
  • One stale layout line leaves cycles-allowlist.json.

Closes linuxfoundation/lfx-cdp-insights-ops#248

Copilot AI balanced review requested due to automatic review settings October 16, 2026 12:42
@cursor

cursor Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

PR Summary

Low Risk
Narrow refactor limited to menu collapse UI; removed resize/mobile Vuex state had no remaining consumers in the app.

Overview
Replaces the Vuex layout module with a Pinia useLayoutStore that only holds menu collapse state and toggleMenu. The side menu now reads/writes that state via Pinia instead of layout/toggleMenu dispatch and mapGetters('layout').

app.vue drops the global window resize listener and layout/resize wiring. The old store’s isMobile, responsive getters (paginationLayout, labelPosition, labelWidthFilter), and collapseMenu go away with layout-store.js. layout-module.js no longer registers a Vuex submodule.

cycles-allowlist.json removes the obsolete dependency chain through layout-store.js.

Reviewed by Cursor Bugbot for commit aa311cd. Bugbot is set up for automated code reviews on this repo. Configure here.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The migration is straightforward, with no identified functional regressions or remaining consumers of the removed APIs.

0 open findings

What changed in this PR

Migrates layout state from Vuex to Pinia while preserving menu-collapse behavior.

Changes:

  • Adds useLayoutStore and updates the menu consumer.
  • Removes the legacy Vuex module and unused resize handling.
  • Removes the obsolete layout cycle allowance.
File Description
frontend/​src/​modules/​layout/​pinia/​layout.store.ts Adds Pinia collapse state and toggle action.
frontend/​src/​modules/​layout/​layout-store.js Deletes the legacy Vuex store.
frontend/​src/​modules/​layout/​layout-module.js Removes Vuex store registration.
frontend/​src/​modules/​layout/​components/​menu/​menu.vue Uses the Pinia layout store.
frontend/​src/​app.vue Removes unused layout resize handling.
frontend/​cycles-allowlist.json Removes the obsolete layout cycle entry.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@gaspergrom
gaspergrom merged commit 5787a7e into main Oct 16, 2026
14 checks passed
@gaspergrom
gaspergrom deleted the refactor/CM-1548-layout-pinia branch October 16, 2026 12:46
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