mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-07 02:51:50 +00:00
chore(tui): clean remaining Ink perf scaffolding
Trim narration comments and collapse small one-off helpers in the remaining ui-tui perf support files while preserving behaviour.
This commit is contained in:
parent
7da2f07641
commit
2e4b65b9f5
8 changed files with 43 additions and 78 deletions
|
|
@ -205,11 +205,6 @@ export default class App extends PureComponent<Props, State> {
|
|||
</TerminalSizeContext.Provider>
|
||||
)
|
||||
}
|
||||
override componentDidMount() {
|
||||
// Keep the native terminal cursor visible. Ink parks it at the declared
|
||||
// input caret after each frame, so the terminal emulator provides the
|
||||
// normal blinking block/bar without React-driven blink re-renders.
|
||||
}
|
||||
override componentWillUnmount() {
|
||||
if (this.props.stdout.isTTY) {
|
||||
this.props.stdout.write(SHOW_CURSOR)
|
||||
|
|
@ -574,9 +569,7 @@ export function handleMouseEvent(app: App, m: ParsedMouse): void {
|
|||
const row = m.row - 1
|
||||
const baseButton = m.button & 0x03
|
||||
|
||||
// Allow disabling app click/selection handling while keeping wheel scroll
|
||||
// and DOM mouse dispatch alive. Put this after coordinate/button decoding
|
||||
// and exempt non-left buttons so scrollbar/right-click handlers still work.
|
||||
// Disable app click handling without blocking wheel/right-click dispatch.
|
||||
if (isMouseClicksDisabled() && baseButton === 0) {
|
||||
return
|
||||
}
|
||||
|
|
|
|||
|
|
@ -124,20 +124,6 @@ function ScrollBox({ children, ref, stickyScroll, ...style }: PropsWithChildren<
|
|||
})
|
||||
}
|
||||
|
||||
const scrollByNow = (dy: number) => {
|
||||
const el = domRef.current
|
||||
|
||||
if (!el) {
|
||||
return
|
||||
}
|
||||
|
||||
el.stickyScroll = false
|
||||
manualScrollAtRef.current = Date.now()
|
||||
el.scrollAnchor = undefined
|
||||
el.pendingScrollDelta = (el.pendingScrollDelta ?? 0) + Math.floor(dy)
|
||||
scrollMutated(el)
|
||||
}
|
||||
|
||||
useImperativeHandle(
|
||||
ref,
|
||||
(): ScrollBoxHandle => ({
|
||||
|
|
@ -173,7 +159,19 @@ function ScrollBox({ children, ref, stickyScroll, ...style }: PropsWithChildren<
|
|||
}
|
||||
scrollMutated(box)
|
||||
},
|
||||
scrollBy: scrollByNow,
|
||||
scrollBy(dy: number) {
|
||||
const el = domRef.current
|
||||
|
||||
if (!el) {
|
||||
return
|
||||
}
|
||||
|
||||
el.stickyScroll = false
|
||||
manualScrollAtRef.current = Date.now()
|
||||
el.scrollAnchor = undefined
|
||||
el.pendingScrollDelta = (el.pendingScrollDelta ?? 0) + Math.floor(dy)
|
||||
scrollMutated(el)
|
||||
},
|
||||
scrollToBottom() {
|
||||
const el = domRef.current
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue