fix(glasses): every card on a renamed board badged "todo", including cards in review - #3015
Conversation
…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.
015572c to
7b75a5f
Compare
|
Verified — 10/10, and reverting The fix is the right shape and the reasoning for it is the part worth keeping:
Same family as #3005's The self-correction is the second one today of this exact shape
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 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 fileI deleted its deprecated predecessor |
📝 WalkthroughWalkthroughThe 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. ChangesstatusBadge Lane Fix
Estimated code review effort: 1 (Trivial) | ~5 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
plugins/fusion-plugin-even-realities-glasses/src/cards.ts (1)
73-94: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winConsolidate the duplicated FNXC narrative into one concise comment.
The same multi-paragraph rationale (PR
#2968history, the "confident wrong answer" invariant, the comparison tocolumnLabel) is written twice, once incards.tsand once incards.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 incards.tsinstead 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
📒 Files selected for processing (2)
plugins/fusion-plugin-even-realities-glasses/src/__tests__/cards.test.tsplugins/fusion-plugin-even-realities-glasses/src/cards.ts
Every card on a renamed board badged
todo— including cards in reviewCOLUMN_BADGESmaps the six legacy ids to themselves. On a board whose lanes are named anything else every lookup misses, so every card badgestodo— 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) andnotificationCard(the notification badge).Fix, and the dead weight it exposed
The badge is the column id, so the function now says so:
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 withstatusBadgeas 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
columnLabelin the CLI (COLUMN_LABELS[column] ?? column) for the same reason: a board that calls its lanecheckingshould readchecking. 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
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)
tsc --noEmit,eslint— cleanlifecycle-column-census --strict,check-lane-wiring,check-sql-column-literals,check-inert-flag-seams,check-fnxc-future-dates— greenNo changeset: the plugin is
private: trueand is not bundled into the published CLI.Summary by CodeRabbit