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:
Brooklyn Nicholson
2026-04-17 11:00:15 -05:00
parent a82097e7a2
commit 8f553a55b2
4 changed files with 12 additions and 7 deletions

View File

@@ -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])