dsh-tidy-display 0.2.2 → 0.2.3-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,45 @@
1
+ import React, { useRef, useState } from 'react';
2
+ import { createRoot } from 'react-dom/client';
3
+ import { StickyLane } from '../src/client/StickyLane.js';
4
+ import { Disclosure } from '../src/client/motion.js';
5
+ import css from '../src/client/Reader.module.css';
6
+
7
+ /** Mirrors the user report: a closed turn whose long answer is read mid-scroll. */
8
+ function Fixture() {
9
+ const [expanded, setExpanded] = useState(false);
10
+ const button = useRef<HTMLButtonElement>(null);
11
+ const button2 = useRef<HTMLButtonElement>(null);
12
+ return <div data-conversation-scroll id="scrollport" style={{ height: 'calc(100vh - 32px)', overflow: 'auto' }}>
13
+ <div className={css.root} data-dsh-tidy-display="fixture">
14
+ <div className={css.column} data-chat-flow="">
15
+ <StickyLane kind="toolbar" className={css.toolbar}>
16
+ <button className={css.textButton}>自动折叠开</button>
17
+ </StickyLane>
18
+ <section className={css.turn} data-reader-turn="1">
19
+ <div style={{ height: 120, background: '#eef2ff', alignSelf: 'flex-end', width: '65%' }}>用户消息</div>
20
+ <StickyLane kind="status" className={css.turnProcessSticky}>
21
+ <Disclosure open={expanded} onChange={setExpanded} buttonRef={button} label={<span>用时 4 分 1 秒</span>} />
22
+ </StickyLane>
23
+ <div className={css.closedProcessSummary} data-reader-closed-summary="思考×15 · 输出×1 · 工具×22 · 记录×1">
24
+ <div className={css.summaryRow}>
25
+ <Disclosure open={expanded} onChange={setExpanded} controls="body" buttonRef={button2} ariaLabel="过程详情"
26
+ label={<span>思考×15·输出×1·工具×22·记录×1</span>} />
27
+ </div>
28
+ </div>
29
+ <div id="body" data-reader-answer style={{ padding: '8px 0' }}>
30
+ {Array.from({ length: 40 }, (_, i) => (
31
+ <div key={i} style={{ padding: '6px 0 6px 40px', borderBottom: '1px solid #eee' }}>
32
+ 回答正文行 {i} —— .agent-presets/standard-win/ ⚠ 必须改 硬编码了 linux 绝对路径
33
+ </div>
34
+ ))}
35
+ </div>
36
+ </section>
37
+ <section className={css.turn} data-reader-turn="2" style={{ paddingTop: 20 }}>
38
+ <div style={{ height: 400, background: '#f2fff2' }}>下一轮内容占位</div>
39
+ </section>
40
+ </div>
41
+ </div>
42
+ </div>;
43
+ }
44
+
45
+ createRoot(document.getElementById('app')!).render(<Fixture />);