Skip to content

fix(glasses): every card on a renamed board badged "todo", including cards in review - #3015

Merged
gsxdsm merged 1 commit into
mainfrom
fix/glasses-badge-renamed-lanes
Jul 31, 2026
Merged

fix(glasses): every card on a renamed board badged "todo", including cards in review#3015
gsxdsm merged 1 commit into
mainfrom
fix/glasses-badge-renamed-lanes

Conversation

@gsxdsm

@gsxdsm gsxdsm commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

Every card on a renamed board badged todo — including cards in review

export function statusBadge(column: Task["column"]): string {
  return COLUMN_BADGES[column] ?? "todo";
}

COLUMN_BADGES maps the six legacy ids to themselves. On a board whose lanes are named anything else every lookup misses, so every card badges todo — a card sitting in review tells the wearer it is un-started, and the whole board carries one identical badge.

On a display with room for a single word, that is worse than an unrecognised lane: it is a confident wrong answer rather than a missing one.

Reached from taskToCard (the main card) and notificationCard (the notification badge).

Fix, and the dead weight it exposed

The badge is the column id, so the function now says so:

export function statusBadge(column: Task["column"]): string {
  return column;
}

That also retires COLUMN_BADGES. Once the fallback is the id, a table mapping each legacy id to itself decides nothing — six lane literals sat in this file doing no work. It was module-private with statusBadge as its only consumer and it was a pure identity, so behaviour on legacy boards is byte-identical: this is not a behaviour change riding along with a cleanup, it is the dead weight the fix exposed, removed rather than left as a decoy.

Mirrors columnLabel in the CLI (COLUMN_LABELS[column] ?? column) for the same reason: a board that calls its lane checking should read checking. No resolution needed; the id is in hand at the call site.

Note the census count for this file does not move — those six were object keys, not comparisons, which is exactly the scope the census documents for itself.

This is a miss in my own #2968

That PR fixed the summary card's counts in this same file and never looked one function further at the per-card badge those counts sit above. Worth saying plainly, because it is the practical reminder behind the census finding I have been repeating all run: a file having had a defect fixed is not evidence about its neighbours — and here the neighbour was nine lines away, in a function I had read.

Revert proof

AssertionError: expected 'todo' to be 'checking'
      Tests  1 failed | 9 passed (10)

The paired case ("still badges the legacy ids exactly as before") passes both ways by design — it guards against the fallback change altering known boards, so I am not counting it as coverage of the defect.

Verification (measured)

  • plugin suite — 198 passed / 19 files
  • tsc --noEmit, eslint — clean
  • lifecycle-column-census --strict, check-lane-wiring, check-sql-column-literals, check-inert-flag-seams, check-fnxc-future-dates — green

No changeset: the plugin is private: true and is not bundled into the published CLI.

Summary by CodeRabbit

  • Bug Fixes
    • Status badges now accurately display a card’s actual lane, including previously unrecognized lanes.
    • Preserved existing badge behavior for known lanes.
  • Tests
    • Added coverage to verify accurate lane reporting and legacy behavior.

…cards in review

`statusBadge` returned `COLUMN_BADGES[column] ?? "todo"`, where `COLUMN_BADGES` mapped
the six legacy ids to themselves. On a board whose lanes are named anything else every
lookup missed and the badge read `todo` — a card sitting in review told the wearer it
was un-started, and every card on the board carried the same badge. On a display with
room for one word that is a confident wrong answer, which is worse than an unrecognised
one.

The badge IS the column id, so the function now says so, and the map goes with it: once
the fallback is the id, a table mapping each legacy id to itself decides nothing, and
six lane literals were sitting in this file doing no work. Behaviour on legacy boards is
byte-identical either way — the map was an identity — so this is not a behaviour change
riding along, it is the dead weight the fix exposed, removed rather than left as a decoy
for the next reader.

Mirrors `columnLabel` in the CLI (`COLUMN_LABELS[column] ?? column`): a board that calls
its lane `checking` should read `checking`, which is true and already what its operator
recognises. No resolution needed — the id is in hand at the call site.

This is a miss in my own #2968. That PR fixed the summary card's counts in this same
file and did not look one function further at the per-card badge those counts sit above
— the practical form of the point I keep making about census counts: a file having had a
defect fixed is not evidence about its neighbours, and this neighbour was nine lines away
in a function I had read.

Reverted: expected 'todo' to be 'checking'.

Verified: plugin suite 198 passed / 19 files; tsc and eslint clean; census (unchanged —
object keys are not comparisons), lane-wiring, inert-seam and fnxc gates green. No
changeset — the plugin is private and not bundled into the published CLI.
@gsxdsm
gsxdsm force-pushed the fix/glasses-badge-renamed-lanes branch from 015572c to 7b75a5f Compare July 31, 2026 07:35
@gsxdsm

gsxdsm commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator Author

Verified — 10/10, and reverting statusBadge to the legacy lookup with its ?? "todo" default fails 1 of 10.

The fix is the right shape and the reasoning for it is the part worth keeping:

No resolution needed — the id is in hand at the call site.

return column is better than any trait resolution here, because the failure was never "we don't know the lane" — the id was always present, it was being translated through a table that only knew six names. A lookup with a default is exactly the construct that converts "unknown" into a confident wrong answer, and ?? "todo" picked the most damaging possible one: a card in review reporting itself un-started, on a display with room for a single word.

Same family as #3005's scannedColumns (a hardcoded claim printed as an observation) and #2992's Repairs: 0an instrument answering about a population it cannot see. Here the default made it worse than silence: an empty badge would have been honest.

The self-correction is the second one today of this exact shape

Missed by #2968, which fixed the summary card's counts in this same file and did not look one function further at the per-card badge those counts sit above.

That is #3014's lesson again, independently: a passing test at the seam you fixed says nothing about the seam next to it. #2968 fixed the counts, verified them, and left the badge those counts sit above reading todo for every card. Two PRs in one batch found by re-reading the file around a fix rather than the fix itself.

Worth noting for the workflow-learnings doc (#3012 thread): both cases were found by the original author re-examining their own merged work, not by review. That is a cheap habit with a good hit rate — after a fix lands, read its neighbours.

Context I have on this file

I deleted its deprecated predecessor fusion-plugin-even-cards in #2988, on the evidence that the consolidation into this plugin was a documented decision. That makes this plugin the sole surviving Even Realities surface — so a wrong badge here has no second implementation masking it, and the two census entries that used to sit in the dead package are gone. Nothing in this PR conflicts with that; noting it since I touched the neighbourhood.

@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The change removes the COLUMN_BADGES mapping in cards.ts. The statusBadge function now returns the task column identifier directly instead of defaulting unrecognized lanes to "todo". Tests were added to verify this behavior for unrecognized and legacy lanes.

Changes

statusBadge Lane Fix

Layer / File(s) Summary
statusBadge implementation change
plugins/fusion-plugin-even-realities-glasses/src/cards.ts
Removes the COLUMN_BADGES identity mapping. statusBadge returns the provided column identifier directly instead of defaulting unknown columns to "todo".
Tests for statusBadge lane behavior
plugins/fusion-plugin-even-realities-glasses/src/__tests__/cards.test.ts
Adds Task type import and statusBadge import. Adds test cases verifying statusBadge returns the actual lane name for unrecognized lanes and preserves legacy behavior for known lanes.

Estimated code review effort: 1 (Trivial) | ~5 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the fix for cards on renamed boards being incorrectly badged as "todo".
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/glasses-badge-renamed-lanes

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot 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.

🧹 Nitpick comments (1)
plugins/fusion-plugin-even-realities-glasses/src/cards.ts (1)

73-94: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Consolidate the duplicated FNXC narrative into one concise comment.

The same multi-paragraph rationale (PR #2968 history, the "confident wrong answer" invariant, the comparison to columnLabel) is written twice, once in cards.ts and once in cards.test.ts. Both blocks exceed the "concise FNXC comments" guideline for technical decisions.

  • plugins/fusion-plugin-even-realities-glasses/src/cards.ts#L73-L94: Keep a short FNXC comment stating the decision (statusBadge returns the column id directly, no fallback) and drop the extended history; this is the single source of truth for the rationale.
  • plugins/fusion-plugin-even-realities-glasses/src/__tests__/cards.test.ts#L110-L131: Remove the duplicated narrative before the tests and, if traceability to the decision is needed, reference the FNXC comment in cards.ts instead of restating it.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@plugins/fusion-plugin-even-realities-glasses/src/cards.ts` around lines 73 -
94, Shorten the FNXC comment in
plugins/fusion-plugin-even-realities-glasses/src/cards.ts#L73-L94 to state only
that statusBadge returns the column id directly without a fallback, retaining
this as the sole rationale source. Remove the duplicated narrative from
plugins/fusion-plugin-even-realities-glasses/src/__tests__/cards.test.ts#L110-L131;
if traceability is needed, reference the FNXC comment in cards.ts rather than
repeating it.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@plugins/fusion-plugin-even-realities-glasses/src/cards.ts`:
- Around line 73-94: Shorten the FNXC comment in
plugins/fusion-plugin-even-realities-glasses/src/cards.ts#L73-L94 to state only
that statusBadge returns the column id directly without a fallback, retaining
this as the sole rationale source. Remove the duplicated narrative from
plugins/fusion-plugin-even-realities-glasses/src/__tests__/cards.test.ts#L110-L131;
if traceability is needed, reference the FNXC comment in cards.ts rather than
repeating it.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 5434e16d-5206-4f2a-96eb-7947875260f8

📥 Commits

Reviewing files that changed from the base of the PR and between e9f587c and 7b75a5f.

📒 Files selected for processing (2)
  • plugins/fusion-plugin-even-realities-glasses/src/__tests__/cards.test.ts
  • plugins/fusion-plugin-even-realities-glasses/src/cards.ts

@gsxdsm
gsxdsm merged commit 083f8f5 into main Jul 31, 2026
6 checks passed
@gsxdsm
gsxdsm deleted the fix/glasses-badge-renamed-lanes branch July 31, 2026 07:47
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.

1 participant