Skip to content

Phase 6: Rename PRReviewStore to PRUIStore and drop GitHubStore dependency #359

Description

@jennings

Clean up what's left after the fetched data is gone.

Changes

  • Drop PRReviewStore's constructor dependency on GitHubStore — it was only used for fetches.
  • Remove the seeded initialPr / initialFiles provider props. If pre-seeding is desired for zero-flash route entry, call queryClient.setQueryData(...) at the route level instead.
  • Delete loadPRData / loadOverviewData / loadVersionData if any residual code remains after Phases 1-4.
  • Rename the store class (still useful) — proposed: PRUIStore. Rename PRReviewProviderPRUIProvider, usePRReviewStoreusePRUIStore, usePRReviewSelectorusePRUISelector. Update all consumers.
  • Prune imports; delete useCurrentUserLoader.ts and any other now-empty hook files.

Test rewrite

src/browser/contexts/pr-review/index.test.ts today mocks GitHubStore and injects fixtures through the store. After the earlier phases most of these tests are obsolete. Rewrite as:

  • Focused unit tests for the remaining store methods (UI state transitions, navigation, viewed-files toggling, drafts).
  • Delete tests that exercised fetched-data setters — those are now covered by RQ hook tests + optimistic-update tests from earlier phases.
  • Verify the store class no longer imports GitHubStore or any fetch modules.

Tests

  • Post-rename: full test suite passes; no consumer still imports the old names.
  • Store class file line count drops meaningfully (target: under 1,500 lines from ~4,355).

Part of #351

Depends on #353, #354, #355, #356, #357, #358.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Default priority

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions