Skip to content

feat: zen mode full-screen writing view with live TOC#12

Draft
abhi11verma wants to merge 6 commits into
mainfrom
claude/zen-mode-writing-view-CcF3o
Draft

feat: zen mode full-screen writing view with live TOC#12
abhi11verma wants to merge 6 commits into
mainfrom
claude/zen-mode-writing-view-CcF3o

Conversation

@abhi11verma
Copy link
Copy Markdown
Owner

$(cat <<'EOF'

Summary

  • Adds a full-screen Zen Mode writing overlay — a distraction-free environment covering the sidebar and all UI chrome
  • Left TOC panel parses #, ##, ### headings live as you type and renders them as clickable links that scroll to the heading; a toggle collapses the panel to a compact dot view (dot size reflects heading level)
  • Center WYSIWYG editor uses Tiptap with the Markdown extension — full GFM formatting rendered in real-time with larger, more readable typography (17px base, generous line-height)
  • Content auto-saves to localStorage with 800ms debounce and shows a "saved / saving…" indicator
  • Trigger via the "Focus" button in the sidebar footer or keyboard shortcut ⌘⇧Z; close with the × button or Esc

Files changed

File Change
src/components/ZenModeView.jsx New component — full zen mode overlay
src/components/atoms/Icons.jsx Add IconFocus (maximize-corners icon)
src/App.jsx Add showZen state, ⌘⇧Z shortcut, render overlay
src/components/Sidebar.jsx Add Focus button with shortcut hint
src/index.css Add .zen-editor typography overrides

Test plan

  • Click Focus in the sidebar — zen overlay appears full-screen
  • Type # Heading 1, ## Section, ### Sub — TOC updates live
  • Click a TOC item — editor scrolls to that heading
  • Click the collapse button — headings become dots; hover shows title tooltip; clicking dots still scrolls
  • Click to re-expand — text labels return
  • Close with × button and Esc — overlay dismisses, app state unchanged
  • ⌘⇧Z toggles zen mode from any view
  • Content persists across open/close (localStorage)
  • Verify no regressions on normal thread view, sidebar navigation, search modal

https://claude.ai/code/session_01MVsAnPMSQPUcAGRZTfgHyU
EOF
)


Generated by Claude Code

claude added 6 commits May 4, 2026 07:29
Adds a distraction-free writing overlay triggered from the sidebar
Focus button or ⌘⇧Z shortcut. Features a live table of contents
derived from # headings with collapsible dot view and scroll-to-heading
navigation, a centered WYSIWYG Tiptap editor with larger serif-friendly
typography, and auto-save to localStorage.

https://claude.ai/code/session_01MVsAnPMSQPUcAGRZTfgHyU
Zen mode is now an inline upgrade of the existing thread note composer
rather than a separate editor. Clicking the focus icon (or pressing Esc
to exit) toggles a full-screen overlay that reuses the same Tiptap editor
instance — no remount, no content loss, undo history preserved.

- ThreadView: fixed-position overlay on zen toggle, TOC panel derived
  from heading lines in current draft text, collapsible to dot view,
  click-to-scroll via new scrollToHeading on MarkdownEditor ref
- MarkdownEditor: adds scrollToHeading() to imperative handle
- Removes ZenModeView standalone component and App/Sidebar wiring

https://claude.ai/code/session_01MVsAnPMSQPUcAGRZTfgHyU
- X button is now position:absolute in the top-left corner (no header bar)
- TOC panel has no borderRight — sits on the same background as the editor
- Thread title flows as part of the document content (h1 above the composer)
- Removed the flexDirection:column wrapper; layout is a flat flex row
- TOC top padding (72px) clears the floating X button naturally

https://claude.ai/code/session_01MVsAnPMSQPUcAGRZTfgHyU
…or, submit top-right

- Submit button moves to position:absolute top-right; removed from bottom bar in zen mode
- TOC panel: justifyContent:center + height:100% so headings float in the vertical middle
  of the viewport regardless of content scroll position
- Composer box in zen mode: background transparent, no borderRadius, no padding —
  text sits directly on the page surface, no visual box
- Editor minHeight: calc(100vh - 260px) gives a large open canvas feel
- Bottom bar hidden in zen mode; only a subtle type indicator + decision toggle appear
  beneath the cursor line when text is present
- Normal mode bottom bar unchanged

https://claude.ai/code/session_01MVsAnPMSQPUcAGRZTfgHyU
- Dark canvas overlay (#1f1d1c bg, Cormorant Garamond serif 22px/1.55)
- CSS grid layout with animated column transition (56px ↔ 220px)
- TOC vertically centered via flex align-items: center on full-height aside
- Collapsed TOC shows tick marks (h-lines: 28/20/14px wide) not dots
- Expanded TOC shows Cormorant Garamond serif heading titles with accent border-left on hover
- Hamburger toggle (top-left, ⌘\ shortcut) replaces X button
- Crumb (top-right): "zen · filename · esc" in JetBrains Mono
- Meta stats (bottom-right): "— h1·N · h2·N · h3·N — Nw · post ⌘↵"
- TOC starts collapsed by default
- Add Cormorant Garamond to Google Fonts import in index.html

https://claude.ai/code/session_01MVsAnPMSQPUcAGRZTfgHyU
- MarkdownEditor: use a ref for onKeyDown to avoid stale closure in
  Tiptap's useEditor — previously the editor always called the initial
  handler which had zenMode=false captured, so Esc never exited zen mode
- Zen canvas: maxWidth 720→900, horizontal padding 60→40px for more space

https://claude.ai/code/session_01MVsAnPMSQPUcAGRZTfgHyU
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.

2 participants