fix(web-read-card): align highlight grammars with read hints, fix fixture schema, restore running sweep
Register the full grammar set the read tool's langFromPath emits (python,
go, rust, yaml, markdown, html, and the rest) so a read card highlights the
same extensions the backend recognizes instead of returning undefined for
them. Rewrite highlightLines' terminator-line check to the explicit
last !== undefined form to keep a single branch for per-file coverage.
Add the running-state sweep animation to ReadRow, matching BashRow/ToolRow,
so a running read row shows executing feedback.
Use file_path (the real read tool schema field) in the turn 66 read fixture
sample, its presentCall branch, and the turn 64 run_code read sub-dispatches,
so the built-boot snapshot replays a production-shaped call and the details
panel shows the correct Input JSON.
Document why ReadBlock omits TerminalBlock's empty-window copy guard, and
correct the read-card-model {@link} and the turn 66 fixture comment.
This commit is contained in:
@@ -131,6 +131,13 @@ export function ReadBlock({
|
||||
<span className={css.count}>{`显示 ${lines.length} / ${totalLines} 行`}</span>
|
||||
)}
|
||||
<span className={css.lang}>{lang ?? ''}</span>
|
||||
{/* No empty-window guard around the copy control, unlike TerminalBlock
|
||||
(which hides copy on empty output): a read card is reached only for
|
||||
a settled read whose result view declares `card:'read'`, and the
|
||||
read tool projects that view solely for a parsed envelope with a
|
||||
line window. An empty or non-envelope result falls back to the
|
||||
generic card upstream (readCardModel returns null), so `lines` is
|
||||
never empty here — the branch TerminalBlock needs cannot arise. */}
|
||||
<button type="button" className={css.copyButton} onClick={onCopy}>
|
||||
{copied ? '复制成功' : '复制'}
|
||||
</button>
|
||||
|
||||
Reference in New Issue
Block a user