fix(editor): Task 7 round 1, reveal reset, forced-colors ring

This commit is contained in:
bchanot committed 2026-11-14 14:28:20 +01:00
1 parent 085c56877c
commit 4018344ffc
5 files changed
+37 -5

No files matched your search

@@ -42,7 +42,7 @@ interface Props extends EditorPlaceProps {
/** A panel takes the focus after « Plus »: the ring shows for the keyboard only. */
const PANEL_FOCUS =
'focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent)]'
'focus:outline-none focus-visible:outline-2 focus-visible:outline-transparent focus-visible:ring-2 focus-visible:ring-[var(--color-accent)]'
function TabPanel({
id,
@@ -140,7 +140,10 @@ function useRestoredView(owner: HistoryOwner) {
return view
}
/** A step that brought a finding back shows Constats, where its row is revealed. */
/**
* A step that brought a finding back shows Constats, where its row is revealed. The tab
* move is a history entry on purpose: Back returns to where the user was.
*/
function useShowRestored(nav: EditorNavigation) {
const revealed = useEditorStore((s) => s.revealed)
const { tab } = nav.state
@@ -63,8 +63,8 @@ function useFindingDeletion(
setAsk({ target, fallback: fallbackAfterRemoval(items, item) })
}
// The element is gone: its dialog closes in the same move, by the pop of its entry (a
// Back step that was taken, never a dead one left behind) and the focus lands on the nearest row once every dialog is closed, unless a newer
// landing supersedes it.
// Back step that was taken, never a dead one left behind). The focus lands on the
// nearest row once every dialog is closed, unless a newer landing supersedes it.
const closeDelete = () => {
setAsk(null)
if (!ask || currentItems().some((item) => item.id === selectedId)) return
+1 -1
View File
@@ -83,7 +83,7 @@ export function stepHistory(
if (!replaced.ok) return replaced
const patch = replacedPatch(state, step.text, replaced.state, step.history)
const key = appearedFinding(state.documentText, step.text)
api.set(key ? { ...patch, revealed: { key } } : patch)
api.set({ ...patch, revealed: key ? { key } : null })
return { ok: true }
}