Skip to content

refactor: convert the shared pinia store to a setup store (CM-1564) - #5003

Merged
gaspergrom merged 4 commits into
mainfrom
refactor/CM-1564-setup-store
Oct 16, 2026
Merged

gaspergrom merged 4 commits into
mainfrom
refactor/CM-1564-setup-store

Conversation

@gaspergrom

Copy link
Copy Markdown
Contributor

Summary

Converts the shared Pinia store (id shared, reportDataModal and setReportDataModal) to a one-file setup store. The nine consumers are untouched and keep working. shared.actions.ts, shared.getters.ts and shared.state.ts are deleted. Type errors on main drop from 31 to 30, since shared.actions.ts carried the last error CM-1536 deferred.

  • The report data payload types its project affiliations.

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

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
Internal store refactor with unchanged consumer API and stricter typing; no auth or data-path changes.

Overview
Collapses the shared Pinia store into a single setup-style shared.store.ts and removes shared.actions.ts, shared.getters.ts, and shared.state.ts. Behavior for callers stays the same: reportDataModal and setReportDataModal are still exposed on useSharedStore.

The modal payload is now modeled as ReportDataModalPayload instead of loose any (including a union for attribute and typed project affiliations on segment data). The frontend typecheck baseline drops from 31 to 30 errors.

Reviewed by Cursor Bugbot for commit 52992d7. 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

Static review supports consumer compatibility and found no blocking issues; typechecking was not rerun.

0 open findings

What changed in this PR

Consolidates the shared Pinia store into a setup store while preserving its existing API for all nine consumers.

Changes:

  • Combines state and actions in one file and removes obsolete modules.
  • Adds typed report payloads, including project affiliations.
  • Lowers the typecheck error baseline from 31 to 30.
File Description
frontend/​typecheck-baseline.json Updates the expected error count to 30.
frontend/​src/​shared/​pinia/​shared.store.ts Implements the setup store and typed payload.
frontend/​src/​shared/​pinia/​shared.state.ts Removes the separate state module.
frontend/​src/​shared/​pinia/​shared.getters.ts Removes the empty getters module.
frontend/​src/​shared/​pinia/​shared.actions.ts Removes actions now implemented in the store.

🧠 Review effort: Balanced


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

Signed-off-by: Gašper Grom <gasper.grom@gmail.com>
Copilot AI balanced review requested due to automatic review settings October 16, 2026 12:49

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 refactor preserves consumer compatibility, with no unresolved findings or blocking regressions identified.

0 open findings

🧠 Review effort: Balanced

@gaspergrom
gaspergrom merged commit 461a6e0 into main Oct 16, 2026
14 checks passed
@gaspergrom
gaspergrom deleted the refactor/CM-1564-setup-store branch October 16, 2026 12:51
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