Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions UPSTREAM.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Upstream maintenance

Mobile diff grammar tests: `apps/mobile/src/features/diffs/nativeReviewDiffHighlighter.test.ts`
disables Shiki's per-line wall-clock timeout in its real-highlighter test wrapper.
The inherited 500ms cutoff can return partial tokens and incomplete grammar state
under runner contention, so equivalent inputs can produce different highlighting.
Keep this test-only override when syncing upstream: these tests cover grammar
boundaries, line/character batching, and cancellation, not elapsed-time fallback.
Production retains the timeout and its partial-highlighting behavior; changing
that behavior needs a separate decision about responsiveness and grammar recovery.

Scient owns desktop/web reader-position policy. The owners are Scient-only files in
`apps/web/src/components/chat/`: `readerScrollPolicy.ts` (the reading end),
`readerScrolling.ts` (reader input, the one position writer, per-frame bookkeeping and
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,14 @@ vi.mock("@shikijs/core", async (importOriginal) => {
...highlighter,
codeToTokensBase: (...input: Parameters<typeof highlighter.codeToTokensBase>) => {
tokenization.calls.push(input[0]);
const result = highlighter.codeToTokensBase(...input);
// SCIENT-FORK:START — grammar assertions must not depend on runner contention.
// Shiki's 500ms per-line timeout can return partial tokens and grammar state.
// Keep the real grammar; only disable its wall-clock cutoff in these tests.
const result = highlighter.codeToTokensBase(input[0], {
...input[1],
tokenizeTimeLimit: 0,
});
// SCIENT-FORK:END
tokenization.afterCall?.();
return result;
},
Expand Down
Loading