mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-28 15:01:34 +08:00
chore(tui): fix eslint/prettier nits from npm run fix
- drop inline `import()` type annotation in useSessionLifecycle (import `PanelSection` at the top like everything else) - include `panel` and `session.resumeById` in the useMainApp useMemo deps now that the event handler depends on them - wrap the derived `selected` range in a useMemo so it has stable identity and stops invalidating the TextInput `rendered` memo every render - prettier re-sorting of a couple of export/import lines
This commit is contained in:
@@ -307,8 +307,11 @@ export function TextInput({
|
||||
const raw = self.current ? vRef.current : value
|
||||
const display = mask ? raw.replace(/[^\n]/g, mask[0] ?? '*') : raw
|
||||
|
||||
const selected =
|
||||
sel && sel.start !== sel.end ? { end: Math.max(sel.start, sel.end), start: Math.min(sel.start, sel.end) } : null
|
||||
const selected = useMemo(
|
||||
() =>
|
||||
sel && sel.start !== sel.end ? { end: Math.max(sel.start, sel.end), start: Math.min(sel.start, sel.end) } : null,
|
||||
[sel]
|
||||
)
|
||||
|
||||
const layout = useMemo(() => cursorLayout(display, cur, columns), [columns, cur, display])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user