Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This adjusts text truncation so Arabic number signs and other Unicode prepend characters are not stranded at the cutoff. Its effects are limited to formatted titles and diagnostic text, with existing limits and defaults unchanged. You can add or adjust custom eligibility rules. Learn more. |
…tPrefix Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Dismissing prior approval to re-evaluate 7dae3f3
EvidenceEnvironment: real web app, Chromium, 1280×800, light theme, isolated fresh databases, Replay (dev) Showcase. On each fresh database, create a demo project, open its new-thread composer with Replay (dev) Showcase selected, enter exactly 49 'a' + U+0600 + U+0661 + ' notes', press Enter, and capture the seeded breadcrumb heading before generated-title replacement. Scenario: A seeded title omits an Arabic number cluster that cannot fitProven: the scenario fails on base 8ec6425010 and passes on head 7dae3f3602.
| Recording | Before recording | After recording | Not shown:
|



Problem
First-message thread titles truncated at the cutoff can retain a lone Unicode
Grapheme_Cluster_Break=Prependcharacter such as an Arabic number sign (U+0600) while dropping the following digit (U+0661) or trailing space, splitting a single grapheme cluster before"...".Deterministic repro on
origin/main(dff224df1db98bcfdee3ef823afcd05899ac7eb1):deriveThreadTitleSeed(packages/client-runtime/src/operations/threadTitle.ts) ->truncate(packages/shared/src/String.ts), sendstitleSeedviastartThreadTurn(apps/web/src/components/chat/useComposerSend.ts:1652), persists it onto thread metadata inOrchestrator.ts:7953(thread.metadata-updated), and renders it viaChatView.tsx:3773intoChatHeader.tsx:363-373(the header heading, tooltiplabel, and buttonaria-label, all receiving the full seed before asynchronous title generation can replace it).deriveThreadTitleFromPrompt(apps/mobile/src/lib/projectThreadStartTurn.ts:97-102) truncates pending and unsent draft titles at 69 UTF-16 code units (when length > 72), feedingpending-new-tasks-model.ts:136,:153andthread-list-v2-items.tsx:723,:861.node --input-type=module -e 'import { deriveThreadTitleSeed } from "./packages/client-runtime/src/operations/threadTitle.ts"; console.log(JSON.stringify(deriveThreadTitleSeed({ text: "a".repeat(49) + "\u0600\u0661 notes", attachments: [] })));'origin/main:"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\u0600..."(ends inU+0600 U+002E U+002E U+002E;U+0661is dropped). The mobile pending-title path similarly returned"a".repeat(68) + "\u0600..."for"a".repeat(68) + "\u0600\u0661 notes".U+0600("a".repeat(49) + "..."forderiveThreadTitleSeed,"a".repeat(68) + "..."forderiveThreadTitleFromPrompt) when the cluster does not fit or when cutoff whitespace is trimmed, and keep the full\u0600\u0661cluster when it fits within the existing budget.Change
In
packages/shared/src/String.ts, addedtrimCutPrefixto trim trailing cutoff whitespace and back up across any trailing UnicodeGrapheme_Cluster_Break=Prependcode points whenever the first excluded code point (including whitespace removed bytrimEnd()) is not a UAX #29Control/CR/LFbreak, using explicit Unicode ranges so it stays portable across Hermes (mobile), Web, Desktop, and Node. Bothtruncate(packages/shared/src/String.ts) and mobile'sderiveThreadTitleFromPrompt(apps/mobile/src/lib/projectThreadStartTurn.ts) now calltrimCutPrefixwithout changing their existing budgets, no-space-before-ellipsis rule, or"..."ellipsis. Added split, full-fit, cutoff-whitespace, multi-prepend, and newline-boundary regressions inpackages/shared/src/String.test.tsand split, full-fit, and cutoff-whitespace regressions inapps/mobile/src/lib/projectThreadStartTurn.test.ts.Scope
Small fix for an obvious bug; no issue needed under CONTRIBUTING.md.
Verification
dff224df1db98bcfdee3ef823afcd05899ac7eb1):vp test run packages/shared/src/String.test.ts -t "moves the cut back so prepend signs stay with their following character"failed (Expected: "a".repeat(49) + "...",Received: "a".repeat(49) + "\u0600..."), andderiveThreadTitleSeedreturned tail code pointsU+0600 U+002E U+002E U+002E.49d03e4df0e4242931be6ac1e401b9e9a347c8ae):vp test run packages/shared/src/String.test.ts apps/mobile/src/lib/projectThreadStartTurn.test.tspassed (17/17 across both files), covering split, full-fit, cutoff-whitespace, multi-prepend, and newline boundaries ontruncateand split, full-fit, and cutoff-whitespace on mobilederiveThreadTitleFromPrompt.vp run check:changed: exit0on49d03e4df0e4242931be6ac1e401b9e9a347c8ae(formatpass,lintpass with 0 warnings/errors,knippass,typecheck37/37 packages pass,test3 files / 19 tests pass,react compilerpass).check:changedexit summary for49d03e4df0e4242931be6ac1e401b9e9a347c8ae): https://gist.github.com/saphid/f29507a94403c6c6f01dff4fe8b8468fscenarios:proverun (submitting the exact prompt in a fresh Replay thread and asserting the header accessible name before title generation replaces the seed), live Electron desktop window, and iOS/Android mobile device rendering.Authored by Gemini 4 Neon (Antigravity); reviewed by GPT-6.2 Sol (Codex).
Not shown