Skip to content

refactor: consolidate result-table folders into results/ (#691)#705

Open
grzanka wants to merge 1 commit into
masterfrom
claude/issue-691-OGuyE
Open

refactor: consolidate result-table folders into results/ (#691)#705
grzanka wants to merge 1 commit into
masterfrom
claude/issue-691-OGuyE

Conversation

@grzanka
Copy link
Copy Markdown
Contributor

@grzanka grzanka commented Jun 4, 2026

Summary

Closes #691. Consolidates the two confusingly-named, near-identical result-table
locations under src/lib/components/ into a single canonical results/
directory, so the component tree is self-documenting and contributors no longer
have to open files to learn which table is which.

Moves (all via git mv, history preserved)

  • result-table.svelteresults/table-multi-program.svelte (the multi-program comparison table)
  • result-table/ partials → results/multi-program/:
    • advanced-header, advanced-result-cells, basic-header, basic-result-cells, input-row-cells, multi-entity-cells, multi-entity-header, types
    • result-table-footer.sveltefooter.svelte (drops the last result-table filename)
  • Tests renamed: result-table.test.tstable-multi-program.test.ts, result-table-advanced.test.tstable-multi-program-advanced.test.ts

Other changes

  • Updated all imports: the multi-program table's relative partial imports, the two header partials' cross-folder import simplified to ../stp-unit-header-menu.svelte (now siblings under results/), the calculator page import, and the test imports.
  • Updated the component tree in docs/03-architecture.md.
  • AI logging: CHANGELOG-AI.md entry + session log + index update.

Pure move + rename — no logic changes. The data-testid="result-table" DOM
attribute is intentionally kept (behavioural contract relied on by E2E specs).

Acceptance criteria

  • One canonical results/ directory; no result-table.svelte / result-table/ left behind.
  • File names communicate purpose (multi-program table is obviously the multi-program table).
  • All imports updated; pnpm check (svelte-check + tsc) passes — 0 errors.
  • pnpm lint clean; moved table tests pass (21/21). (The only failing unit tests are in guard-forbidden-files.test.ts, failing because git commit signing is unavailable in the sandbox — unrelated to this change.)
  • Component tree in docs/03-architecture.md updated.

Test plan

  • pnpm check → 0 errors, 0 warnings
  • pnpm lint → clean
  • pnpm format:check → clean
  • pnpm vitest run for the two moved table specs → 21/21 pass

https://claude.ai/code/session_01AQB6xXACbSPK2DePe2QSoT


Generated by Claude Code

Merge the two confusingly-named, near-identical result-table locations
into a single canonical results/ directory:

- result-table.svelte -> results/table-multi-program.svelte
- result-table/ partials -> results/multi-program/ (footer.svelte renamed
  from result-table-footer.svelte)

Update all imports, the calculator page, the moved component tests, and the
component tree in docs/03-architecture.md. Pure move + rename; no logic
changes. The data-testid="result-table" DOM attribute is intentionally kept.

https://claude.ai/code/session_01AQB6xXACbSPK2DePe2QSoT
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR consolidates the previously split multi-program result table implementation (formerly result-table.svelte + result-table/ partials) into the canonical src/lib/components/results/ subtree, aiming to make the component tree self-describing and remove ambiguous folder naming.

Changes:

  • Updated calculator page + unit/component tests to import the multi-program table from src/lib/components/results/table-multi-program.svelte.
  • Moved/renamed the multi-program table partials under src/lib/components/results/multi-program/ and updated internal imports (including simplifying StpUnitHeaderMenu imports).
  • Updated architecture documentation and AI session logging to reflect the new component tree.

Reviewed changes

Copilot reviewed 10 out of 17 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/tests/components/table-multi-program.test.ts Updates test import to the new multi-program table path under results/.
src/tests/components/table-multi-program-advanced.test.ts Updates advanced-mode test import to the new multi-program table path under results/.
src/routes/calculator/+page.svelte Updates calculator page import to use results/table-multi-program.svelte.
src/lib/components/results/table-multi-program.svelte Updates internal imports to use ./multi-program/* partials and moved types import.
src/lib/components/results/multi-program/types.ts Introduces/relocates ColumnDef typing for the multi-program table.
src/lib/components/results/multi-program/multi-entity-header.svelte Simplifies StpUnitHeaderMenu import to a sibling-relative path.
src/lib/components/results/multi-program/multi-entity-cells.svelte Relocates/introduces multi-entity comparison cell rendering for the multi-program table.
src/lib/components/results/multi-program/input-row-cells.svelte Relocates/introduces row input cell rendering for the multi-program table.
src/lib/components/results/multi-program/footer.svelte Relocates/renames the multi-program table footer component.
src/lib/components/results/multi-program/basic-result-cells.svelte Relocates/introduces basic-mode result cell rendering for the multi-program table.
src/lib/components/results/multi-program/basic-header.svelte Relocates/introduces basic-mode table header rendering for the multi-program table.
src/lib/components/results/multi-program/advanced-result-cells.svelte Relocates/introduces advanced-mode result cell rendering for the multi-program table.
src/lib/components/results/multi-program/advanced-header.svelte Simplifies StpUnitHeaderMenu import to a sibling-relative path.
docs/ai-logs/README.md Adds an index entry for the AI session log covering this refactor.
docs/ai-logs/2026-06-04-issue-691-consolidate-result-tables.md Adds the detailed AI session log for the consolidation work.
docs/03-architecture.md Updates the component tree documentation to reflect the new results/ structure.
CHANGELOG-AI.md Adds the changelog entry linking to the new AI session log.

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.

Consolidate confusing twin result-table folders (result-table/ + result-table.svelte vs results/)

3 participants