Feat/thoroc UI improvements#122
Conversation
- Add hierarchical Table of Contents component with clickable navigation - Implement useActiveSection hook for real-time section highlighting - Add annotationHelpers utility for block identification - Make Images, Global comment, and Copy plan buttons sticky during scroll - Fix navigation scrolling to work within scrollable main container
|
Oh that is annoying indeed. I need to look into it. |
|
Hey guys how are we looking here. I just got back from my only vacation this year and will get these PRs going. |
- Replace surroundContents() with plain text wrapper approach - Add syntax highlighting restoration in removeHighlight() - Fixes issue reported by kkharji in PR backnotprop#122 The old approach used range.surroundContents() which wrapped syntax-highlighted <span> elements, creating nested structure that broke the layout. The new approach replaces code block innerHTML with plain text wrapped in <mark>, then restores syntax highlighting when the annotation is removed. Test coverage: 15 tests pass with edge cases for empty blocks, special chars, large blocks (10k), unicode, and multiple annotation cycles.
- Add 15 test cases covering code block annotation behavior - Test plain text wrapper approach vs nested span approach - Verify syntax highlighting restoration on annotation removal - Cover edge cases: empty blocks, special chars, large blocks, unicode - Add happy-dom dev dependency for DOM testing
…ctions and configure Playwright MCP
- Move comprehensive feature checklists to UI-TESTING-CHECKLIST.md - Keep main UI-TESTING.md focused on development workflow and setup - Add reference link to checklist file for easy navigation
|
@kkharji this should be addressed now
|
|
@backnotprop I'll let you merge this when you're happy with the changes, otherwise say the word. |
|
really cool work. I'm testing now. I may make it a settings config as well to toggle ToC on/off |
|
That's a realty good idea |
IntersectionObserver was using root: null (viewport) instead of the actual scroll container (<main>), and the effect only ran on mount before headings were rendered. Pass the container as root and re-run the observer when heading count changes. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Pushed a fix for the TOC active section tracking ( Two issues in
|
…links Playwright MCP is dev tooling, not for end users. README referenced docs/UI-TESTING.md and docs/CODE-STYLE.md which don't exist at those paths. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Also reverted two unrelated changes (
|
- Smaller text (text-xs) and tighter padding for compact feel - Remove border-l-2 and font-medium from active state to prevent layout shifts that pushed text into multiline - Annotation count badges are now perfect circles (w-5 h-5) - Add left padding to root-level heading Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
TOC styling tweaks (
|
- New uiPreferences.ts utility for cookie-based persistence - TOC toggle: conditionally renders sidebar in App.tsx - Sticky Actions toggle: conditionally applies sticky positioning in Viewer.tsx - Both default to enabled, persisted via cookies Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace flat settings list with sidebar + content panel layout: - General tab: Identity, Permission Mode, Agent Switching - Display tab: TOC, Sticky Actions, Tater Mode - Saving tab: Plan Saving, Obsidian, Bear Notes - Scrollable content area (max-h-[70vh]) - Sidebar hidden in review mode (single tab) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Additional commits pushedfeat(ui): add optional TOC and sticky actions settings (
refactor(ui): redesign Settings dialog with sidebar navigation (
|
…background Match main's button positioning across all breakpoints with responsive margins that account for article padding. Use IntersectionObserver sentinel to detect when the bar is stuck, revealing the card background only on scroll. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sticky action bar positioning fix (
|
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. 🤖 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. Generated with Claude Code
|
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. Generated with Claude Code |
1 similar comment
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. Generated with Claude Code |
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
|
Code review: No issues found. Checked for bugs and CLAUDE.md compliance. |
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. Generated with Claude Code |
2 similar comments
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. Generated with Claude Code |
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. Generated with Claude Code |
…eferences) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>


Summary
feat: Add Table of Contents sidebar with sticky action buttons
What Changed
Files Added/Modified
Testing
Run
bun run build:hook && ./tests/manual/local/test-hook.shto verify the UI locally.