Skip to content

test(lineage): hygiene cleanup from PR #1381 review (DRC-3525)#1452

Open
danyelf wants to merge 1 commit into
mainfrom
feat/drc-3525-hygiene-cleanup
Open

test(lineage): hygiene cleanup from PR #1381 review (DRC-3525)#1452
danyelf wants to merge 1 commit into
mainfrom
feat/drc-3525-hygiene-cleanup

Conversation

@danyelf

@danyelf danyelf commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

What this PR does

Clears the leftover hygiene items from the PR #1381 review (Linear DRC-3525). These are low-risk, self-contained chores — two new tests, one color-hardcoding cleanup, and a guard against a palette that was being kept in sync by hand. No product behavior changes.

The items

1. Test the whole-model badge colors. The helper that picks the palette tokens for the lineage badges (tokensForKind) had no tests at all. Added one that locks its output for every badge kind in both light and dark mode, so a future color tweak can't silently break them.

2. (Deferred) The RECCE_WHOLE_MODEL_IMPACT CLI test. Skipped on purpose. That environment variable was never actually adopted — the real feature flag is RECCE_NEW_CLL_EXPERIENCE / --new-cll-experience. Writing a test for a name that doesn't exist would just bake in confusion. This needs a small product decision (point the test at the real flag, or drop the item), not a mechanical test, so it's left out for now.

3. Two missing edge-case tests for impact propagation. computeWholeModelImpact was covered for the common cases but not for (a) a lineage graph with disconnected pieces — impact shouldn't leak across them — or (b) a changed node that isn't in the graph at all, which shouldn't crash. Both added.

4. Remove hardcoded colors from the lineage node. LineageNode.tsx had raw hex values (#1e1e1e, #ffffff, #000000) repeated inline for the card background and text. Replaced them with the shared design tokens the rest of the lineage UI already uses, selected by the existing dark-mode flag. One small, deliberate normalization: the dark card moves from #1e1e1e to the shared neutral #262626, which matches the sibling node and MUI's dark surface — the old value was the odd one out. Visually imperceptible.

5. Stop the CLL palette from silently drifting. The palette is currently written twice — once as TypeScript constants for the React canvas, once as CSS variables for the schema grid — with a comment admitting the two are kept in sync by hand. Rather than the bigger refactor (generating one side from the other), this adds a test that parses the CSS and asserts the two match, so any future drift fails CI. The proper single-source fix (emit the CSS variables from the TS constants) touches the schema view, so it's left as a follow-up; the guard makes the duplication safe in the meantime.

Tests

All green: 554 lineage tests pass (including the three new/updated files), pnpm type:check clean, Biome lint clean.

User-facing changes

None — tests and internal color sourcing only. The dark lineage-node card shifts #1e1e1e#262626, which is negligible and now consistent with its sibling nodes.

🤖 Generated with Claude Code

- Add wholeModelTreatment.test.ts locking the CLL palette tokens
  produced by tokensForKind across all 5 kinds x light/dark.
- Add computeWholeModelImpact tests for disconnected components and a
  changed node absent from the lineage graph.
- LineageNode.tsx: replace hardcoded #1e1e1e/#ffffff/#000000 surface +
  text literals with shared `colors` design tokens (dark card -> neutral[800],
  matching the sibling LineageColumnNode); de-duplicate the repeated
  primary/inverted text computation.
- Consolidate the CLL palette source of truth: add cllPaletteSync.test.ts,
  a guard test that parses schema/style.css and asserts the TS cll* consts
  match the --schema-* CSS vars (the missing "build-time check"); update the
  "keep in sync by hand" comments to point at it.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Danyel Fisher <danyel@gmail.com>
@gcko gcko self-requested a review July 2, 2026 00:53

@gcko gcko 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.

  • LOW: DRC-3525 item 2 remains intentionally unimplemented. The ticket asked for a CLI env-var test for RECCE_WHOLE_MODEL_IMPACT=true, while the PR body says that name was never adopted and defers the item pending a product decision. I did not see any changed file add equivalent CLI flag/env coverage, so this is acceptable only if the verdict keeps that decision tracked instead of treating the ticket as fully done.
  • LOW: DRC-3525 item 5 says to consolidate the duplicated CLL palette, but this PR leaves the duplication in place and adds a drift guard instead. The new test documents that the colors are still declared twice in js/packages/ui/src/components/lineage/__tests__/cllPaletteSync.test.ts line 21 and that the fuller consolidation is deferred around lines 26-30. The guard substantially lowers drift risk, but it is still a scope tradeoff rather than the requested single-source fix.

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