Skip to content

feat(annotations): Tabbed sidebar with enhanced comment, highlight, note & bookmark UX#8

Merged
kickthemoon0817 merged 3 commits intomainfrom
chore/kye-op-annotation-ux
Mar 17, 2026
Merged

feat(annotations): Tabbed sidebar with enhanced comment, highlight, note & bookmark UX#8
kickthemoon0817 merged 3 commits intomainfrom
chore/kye-op-annotation-ux

Conversation

@kye-op
Copy link
Copy Markdown
Contributor

@kye-op kye-op bot commented Feb 12, 2026

Summary

Major annotation UX overhaul before ML feature phase. Replaces monolithic annotation sidebar with a tabbed (All/Notes/Bookmarks) design and adds numerous workflow improvements across comments, highlights, sticky notes, and bookmarks.

Changes

Annotation Sidebar — Tabbed Design

  • Three-tab layout: All Annotations, Notes, Bookmarks — each with its own focused view
  • Color filter bar: Click color dots to filter highlights by color in the "All" tab
  • Type filter: Filter by annotation type (highlight, underline, etc.) alongside color
  • Clear filters button: One-click reset for all active filters

Comment Workflow

  • Quick add/edit/delete comments via hover actions on annotation rows
  • Comment editor popover with keyboard shortcuts (⌘Enter save, Escape cancel)
  • Clear comment button in editor for quick removal
  • Inline tag management: Remove tags from annotation rows on hover

Highlight UX

  • Fast color switch: Click the color dot on any annotation row → inline color picker
  • Color filter pills: Filter all annotations by highlight color
  • Tag/label support: Add tags with quick suggestions (important, question, todo, methodology, etc.)
  • Tag removal on hover: Remove individual tags without opening a menu

Sticky Notes (Post-it)

  • Sticky note card UI: Collapsible/expandable cards with colored left border accent
  • Notes panel: Dedicated "Notes" tab showing all notes for current document
  • New note creation: "New Note on Page X" button at bottom of Notes tab
  • In-place editing: Edit note content directly in the card
  • Context-aware notes: Creating a note while text is selected captures the selection

Bookmark Improvements

  • One-tap bookmark toggle: Header bookmark button shows filled/unfilled state for current page
  • Bookmark list: Dedicated "Bookmarks" tab with all bookmarks sorted by page
  • Bookmark titles: Editable titles for bookmarks (defaults to "Page N")
  • Current page indicator: Shows "Current" badge for current page bookmark
  • Quick add/remove: Bottom bar in Bookmarks tab for one-tap toggle
  • Jump-to-bookmark: Click any bookmark to navigate to its page

Navigation

  • Click-to-navigate: Clicking an annotation row jumps to its page
  • Page links: "Page N" labels in annotation rows are clickable navigation links

Model Extensions

  • Annotation.isBookmark, Annotation.isNote, Annotation.annotationColor
  • Paper.bookmarks, Paper.notes, Paper.isPageBookmarked(_:), Paper.highlights

Files Changed (6)

  • CHANGELOG.md — New changelog
  • Core/Models/Annotation.swift — Model extensions for filtering helpers
  • Features/Reader/AnnotationSidebarView.swiftNew — All sidebar components
  • Features/Reader/PDFReaderView.swift — Integration, bookmark toggle, note/bookmark handlers
  • Package.swift — Exclude CHANGELOG.md from build
  • Tests/PedefTests/PedefTests.swift — 10 new annotation model tests

Testing

  • All Swift files parse cleanly (swiftc -typecheck -parse)
  • 10 new unit tests for annotation model operations
  • xcodebuild build (CI will validate — SwiftData macros require Xcode toolchain)
  • xcodebuild test (CI will validate)

Risks

  • The old AnnotationSidebarView, AnnotationSectionHeader, and AnnotationRow were removed from PDFReaderView.swift and replaced by the new implementations in AnnotationSidebarView.swift. If any external code referenced these by file path, it would need updating.
  • No schema changes — uses existing noteContent field for bookmark titles.

Follow-up TODOs

  • Keyboard navigation within sidebar tabs (arrow keys, Tab)
  • Drag-and-drop reorder for bookmarks
  • Export annotations as Markdown/PDF
  • Annotation search across all papers (global)
  • Undo/redo integration for annotation sidebar actions
  • Accessibility audit for VoiceOver on new components

Checklist

  • Updated documentation (CHANGELOG.md)
  • Verified UI changes (component design matches PedefTheme)
  • Added tests where feasible

kye-op bot added 3 commits February 13, 2026 02:25
…ote & bookmark UX

## Summary
Major annotation UX overhaul before ML feature phase. Replaces monolithic
annotation sidebar with a tabbed (All/Notes/Bookmarks) design and adds
numerous workflow improvements across comments, highlights, sticky notes,
and bookmarks.

## Key Changes

### Annotation Sidebar — Tabbed Design
- Three-tab layout: All Annotations, Notes, Bookmarks
- Color filter bar for highlights
- Type filter + clear filters button

### Comment Workflow
- Quick add/edit/delete via hover actions on rows
- Dedicated comment editor popover with keyboard shortcuts
- Inline tag management with quick suggestions

### Highlight UX
- Fast color switch via inline color picker (click color dot)
- Color filter pills in sidebar
- Tag support with suggested tags (important, question, todo, etc.)

### Sticky Notes (Post-it)
- Collapsible/expandable card UI with colored border
- Dedicated Notes tab with new note creation
- Context-aware: captures selection when creating note

### Bookmark Improvements
- One-tap toggle: header icon reflects current page state
- Bookmark list tab sorted by page
- Editable bookmark titles, current page indicator
- Quick add/remove from bottom bar

### Navigation
- Click annotation row → jump to page
- Page links in annotation rows are clickable

### Technical
- New: Features/Reader/AnnotationSidebarView.swift (sidebar components)
- Extended: Annotation model helpers (isBookmark, isNote, Paper.bookmarks, etc.)
- 10 new unit tests for annotation model operations
- Added CHANGELOG.md
…set filters on tab switch

HIGH: BookmarksTabView.toggleBookmark() and NotesTabView.createNote()/deleteNote()
now delegate to PDFReaderView callbacks that record via historyService, matching
the pattern already used by PDFReaderView.toggleBookmark() and createStickyNote().

HIGH: Filter state (filterType, filterColor) is now reset when switching sidebar
tabs, preventing stale invisible filters on the All tab.

MEDIUM: Remove dead badgeCount(for:) function (inline dictionary already used).
MEDIUM: Remove redundant .sorted() in BookmarksTabView (already sorted upstream).
MEDIUM: Thread selectedText into NotesTabView so New Note pre-fills content.
MEDIUM: Hoist selectedTab as @binding so createStickyNote() can switch to Notes tab.
@kickthemoon0817 kickthemoon0817 merged commit de1dced into main Mar 17, 2026
@kickthemoon0817 kickthemoon0817 deleted the chore/kye-op-annotation-ux branch March 17, 2026 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant