Repository navigation
feat(cli): VP mode — inline thought expand on click + auto-hiding scrollbar #6079
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,7 +19,7 @@ import { | |
| countMarkdownSourceBlocks, | ||
| type MarkdownSourceCopyIndexOffsets, | ||
| } from '../utils/MarkdownDisplay.js'; | ||
| import { buildThinkingFullTextMap } from '../utils/historyUtils.js'; | ||
| import { buildThoughtHeadIdMap } from '../utils/historyUtils.js'; | ||
| import { ScrollableList, SCROLL_TO_ITEM_END } from './shared/ScrollableList.js'; | ||
|
|
||
| // Limit Gemini messages to a very high number of lines to mitigate performance | ||
|
|
@@ -92,6 +92,7 @@ const virtualIsStaticItem = (item: HistoryItem) => item.id > 0; | |
| export const MainContent = () => { | ||
| const { version } = useAppContext(); | ||
| const uiState = useUIState(); | ||
| const showScrollbar = uiState.showScrollbar ?? true; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Minor: the settingsSchema default, AppContainer ( 中文次要: settingsSchema 默认值、AppContainer( |
||
| const { | ||
| pendingHistoryItems, | ||
| terminalWidth, | ||
|
|
@@ -276,12 +277,12 @@ export const MainContent = () => { | |
| return map; | ||
| }, [historyItemsWithSourceCopyOffsets]); | ||
|
|
||
| const thinkingFullTextByItem = useMemo( | ||
| () => buildThinkingFullTextMap(visibleHistory), | ||
| const thoughtHeadIdByItem = useMemo( | ||
| () => buildThoughtHeadIdMap(visibleHistory), | ||
| [visibleHistory], | ||
| ); | ||
| const thinkingFullTextByItemRef = useRef(thinkingFullTextByItem); | ||
| thinkingFullTextByItemRef.current = thinkingFullTextByItem; | ||
| const thoughtHeadIdByItemRef = useRef(thoughtHeadIdByItem); | ||
| thoughtHeadIdByItemRef.current = thoughtHeadIdByItem; | ||
|
|
||
| const pendingSourceCopyOffsetsByIndex = useMemo( | ||
| () => | ||
|
|
@@ -359,7 +360,7 @@ export const MainContent = () => { | |
| isPending={false} | ||
| commands={uiState.slashCommands} | ||
| sourceCopyIndexOffsets={sourceCopyIndexOffsets} | ||
| thinkingFullText={thinkingFullTextByItemRef.current.get(item)} | ||
| thoughtHeadId={thoughtHeadIdByItemRef.current.get(item)} | ||
| /> | ||
| ); | ||
| }, | ||
|
|
@@ -398,6 +399,7 @@ export const MainContent = () => { | |
| initialScrollIndex={SCROLL_TO_ITEM_END} | ||
| isStaticItem={virtualIsStaticItem} | ||
| containerHeight={scrollContainerHeight} | ||
| showScrollbar={showScrollbar} | ||
| /> | ||
| <ShowMoreLines constrainHeight={uiState.constrainHeight} /> | ||
| </OverflowProvider> | ||
|
|
@@ -430,7 +432,7 @@ export const MainContent = () => { | |
| isPending={false} | ||
| commands={uiState.slashCommands} | ||
| sourceCopyIndexOffsets={sourceCopyIndexOffsets} | ||
| thinkingFullText={thinkingFullTextByItem.get(h)} | ||
| thoughtHeadId={thoughtHeadIdByItem.get(h)} | ||
| /> | ||
| ), | ||
| ), | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Confirmed] Alt+T and per-thought click interact badly: clicking while
allExpandedis on silently poisons the set.resolvedThoughtExpandedis a pure OR, and the mouse handler stays armed on expanded blocks (isActive = !isPending, line 121). Sequence: Alt+T on → user clicks a long thought intending to collapse it → nothing changes visually (OR still true) buttoggleThoughtExpandedadds its head id toexpandedThoughtHeadIds→ user turns Alt+T off → that one thought stays expanded and needs a second click to clear the stale entry. Nothing ever resets the set on Alt+T (the Alt+T handler only doessetThoughtExpanded+refreshStatic(), AppContainer.tsx:3285-3289).Two easy fixes: have the click handler treat
allExpandedas the effective state (delete-only, never add, whileallExpandedis true), or clearexpandedThoughtHeadIdswhenever Alt+T flips (Alt+T then behaves as an absolute set/clear, which matches its "toggle all" label).中文
[已确认] Alt+T 与单条点击交互不良:
allExpanded开启时点击会静默污染集合。resolvedThoughtExpanded是纯 OR,且展开块上鼠标处理器仍然激活(isActive = !isPending,第 121 行)。序列:开 Alt+T → 用户点击长 thought 想收起 → 视觉无变化(OR 仍为 true)但toggleThoughtExpanded把 head id 加入expandedThoughtHeadIds→ 用户关 Alt+T → 该 thought 仍然展开,需再点一次才能清掉脏条目。Alt+T 从不重置集合(其处理器只做setThoughtExpanded+refreshStatic(),AppContainer.tsx:3285-3289)。两个简单修法:点击处理器把
allExpanded视为有效状态(allExpanded为 true 时只删不加);或 Alt+T 翻转时清空expandedThoughtHeadIds(Alt+T 变成绝对的全开/全关,与其"全部切换"的语义一致)。