Skip to content

Commit fc8197b

Browse files
committed
fix(web): address xhigh code-review findings for the document reader (#197)
Correctness / a11y: - Rebuild the reader drawer on Radix Dialog (like KbSettingsSheet) instead of a hand-rolled overlay: proper modal focus trap, initial + return focus, Escape, and background inert (was: aria-modal with none of it) [#4]. This also removes the hand-rolled window keydown listener that re-subscribed every render [#7]. - Restructure each document row so the open-reader target is a real <button> and the delete control is a SIBLING, not nested. Keyboard-activating delete no longer bubbles into opening the reader, and the invalid nested-interactive markup is gone [#1, #5]. - Resolve a source file by the doc's own type (long → .json first, else .md), so two docs sharing a doc_name each resolve to their own file rather than whichever extension is tried first [#2]. - Guard source reads: skip non-dict page entries, reject non-list JSON, and return a controlled 500 on corrupt/unreadable sources instead of an unhandled exception [#3]. - Invalidate the per-hash content cache when the inventory changes, so a reopen after recompile refetches instead of serving stale text [#6]. Fetch/cache/memoized body moved to DocumentsPane so they survive the drawer's unmount-on-close. #8 (frontmatter stripping) intentionally not applied: source docs render verbatim (a user's own frontmatter is content, unlike wiki-page OKF metadata). Adds tests for the collision and malformed-JSON paths.
1 parent 64bd6a9 commit fc8197b

4 files changed

Lines changed: 302 additions & 187 deletions

File tree

0 commit comments

Comments
 (0)