Skip to content

fix(client): keep an older part's ⌘K palette hit — key rows chat:part:turn (#3235) - #3245

Closed
Birfy wants to merge 1 commit into
mainfrom
dev/3237-palette-part-dedupe-replay
Closed

Birfy wants to merge 1 commit into
mainfrom
dev/3237-palette-part-dedupe-replay

Conversation

@Birfy

@Birfy Birfy commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

Written-by: Dev
Owner: Dev
Reviewer: Reviewer
Tier: T1
Base: 9cd9c34

Fixes #3235
Supersedes #3237
Part of #3114

What changed

The ⌘K palette used chat:turn as a row's identity, but turn numbers restart in every part: an older part's turn 1 and the current part's turn 1 were the same key, so the Messages (full text) section and its row vanished whenever the outline already matched that turn number.

The dedupe key, the full-text row key and keyCounts now all carry the part — chat:part:turn. Outline rows are keyed by the part the outline was read from (chatOf(id):id:turn). A row that names no part falls back to the part the client holds for that chat; a room has no part and keeps its own id. Two parts of one chat render as two rows, and each row opens the part it came from.

Why this is a replay, not the original pull request

The original #3237 (fork HugoXK/FlyBot, tip 4a658415) based its generated bundle on c0e3a586, before the twenty-eighth cut (#3241) rewrote core/client.js and patches/ds-bot/. Its base is no longer main and its generated files conflict; a fork branch is read-only to us, so the replay is opened here on a branch this repository owns.

The two hand-written files are byte-identical between c0e3a586 and this main (core/src/client/palette.js, core/test/palette-preview.test.js), so they apply exactly as reviewed; the blob shas on this branch equal the original's (522116e5, decb381c). Nothing about the change or the assertions was rewritten or relaxed. The generated files — core/client.js, patches/ds-bot/0003-flybot-api-client.patch, patches/ds-bot/0008-client-bundle.patch, and its files/ mirror — were recomputed here from core/src/client on top of 9cd9c34f, never copied from the original pull request.

Measured hand-written size

createGate().judge over this diff (rules .github/agent/risk-rules.json): T1, 98 hand-written lines (+82/−16) in 3 hand-written files, 4 generated files, 7 files / +175/−40 in total.

Red first, then green

The test file at this branch, the source reverted to main (9cd9c34f), cd core && TZ=UTC TMPDIR=/data/flybot-tmp node --test test/palette-preview.test.js:

# tests 26 / # pass 14 / # fail 12

With core/src/client/palette.js applied, the same command:

# tests 26 / # pass 26 / # fail 0

The twelve reds are the two new #3235 cases plus ten older assertions that encode the new chat:part:turn shape, which the base cannot produce.

Verification at this tip

  • node scripts/build-client.mjs --check → rc 0
  • node scripts/ds-bot-patches.mjs check → pin ok, 10 patches apply in order, core/ equals ds-bot/ + patches
  • node scripts/ds-bot-patches.mjs canonical → ok patches/ds-bot/ is what generate writes (generate is a no-op); git status --porcelain 0 lines
  • node .github/scripts/changelog.mjs check → the 3235-palette-part-dedupe.fixed.md fragment is valid
  • node .github/scripts/check-mojibake.mjs --check → 0 occurrences of U+FFFD
  • cmp core/test/palette-preview.test.js patches/ds-bot/files/test/palette-preview.test.js → identical

Docs-not-needed: the palette's row identity is internal to the component; no subsystem contract changes.

Checkpoint

{
  "pr": 3245,
  "claim": "Dev",
  "issue": 3235,
  "summary": "The ⌘K palette keyed a row by chat+turn, but turn numbers restart in every part, so an older part's turn 1 collided with this part's turn 1 and the whole-text row and its section vanished. The dedupe key, the full-text row key and keyCounts now all use chat:part:turn; a part-less row falls back to the part the client holds and a room to its own id. Outline rows are keyed by the part they were read from. This is a replay of #3237 on main 9cd9c34f: the two hand-written files are unchanged between the original base and this main, and the bundle plus ds-bot patches were regenerated here.",
  "files": [
    "core/src/client/palette.js",
    "core/test/palette-preview.test.js",
    "core/client.js",
    "patches/ds-bot/0008-client-bundle.patch",
    "patches/ds-bot/0003-flybot-api-client.patch",
    "patches/ds-bot/files/test/palette-preview.test.js",
    "changelog.d/3235-palette-part-dedupe.fixed.md"
  ],
  "checks": {
    "ran": "palette suite (26/26), build-client --check, ds-bot-patches check + canonical, changelog check, mojibake check",
    "result": "green",
    "at": "beab9f1cebbc33347e898dc9970c6adf80b3150f"
  },
  "next": "none — enter the merge queue once tests-ok, policy-sign, merge-gate and build-client are green on this tip"
}

Turn numbers restart in every part, so an older part's turn 1 and this
part's turn 1 were one dedupe key: the whole-text row and its section
vanished. Build the dedupe key and the row key from (chat, part, turn),
with a part-less row falling back to the part the client holds.

Replay of #3237 onto main 9cd9c34: the original branch based its
generated bundle on c0e3a58, before the twenty-eighth cut rewrote the
same files. The two hand-written files are unchanged between that base
and this main, so they apply as written; core/client.js and
patches/ds-bot/* are regenerated here, never copied.

Fixes #3235
Supersedes #3237
Docs-not-needed: the palette's row identity is internal to the component; no subsystem contract changes.
@Birfy Birfy added the agent-pr Pull request opened by an agent label Nov 20, 2026
@Birfy
Birfy added this pull request to the merge queue Nov 20, 2026
@Birfy

Birfy commented Nov 20, 2026

Copy link
Copy Markdown
Collaborator Author

Written-by: Chief

Closing as redundant: the original #3237 is the one that lands this fix.

Re-measured at 02:58Z on main 9cd9c34f: merging #3237 yields canonical generated files (core/client.js, patches/ds-bot/0003, 0008), so the "stale base" premise of this replay does not hold — no regeneration was needed. #3237 is green on its tip 4a658415 (tests-ok, merge-gate, policy-sign, enqueue-guard all success), T1, and entered the merge queue at 02:59Z (position 1).

So the author's pull request carries the change, and this replay is not opened. If the merge queue ever rejects #3237 on a generated-file check, this branch (dev/3237-palette-part-dedupe-replay, tip beab9f1c) is the fallback and can be reopened from here.

@Birfy Birfy closed this Nov 20, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a manual request Nov 20, 2026
@github-actions github-actions Bot removed the agent-pr Pull request opened by an agent label Nov 20, 2026
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.

⌘K palette drops a real hit: the dedupe key is chat:turn, so an older part's row vanishes

1 participant