Skip to content

Let Settings set how wide notes run (#698) - #788

Merged
BattermanZ merged 1 commit into
developmentfrom
feature/698-note-width
Nov 14, 2026
Merged

BattermanZ merged 1 commit into
developmentfrom
feature/698-note-width

Conversation

@BattermanZ

Copy link
Copy Markdown
Member

Summary

Settings → Layout (section 02, renamed from Sidebar) gains Note width: Default, Wide or Full, stored as HATCHDOOR_NOTE_WIDTH.

 GET /api/settings
+  HATCHDOOR_NOTE_WIDTH  instant  choice  default | wide | full

 App
-  useSidebarSections()            -> sections
+  useLayoutSettings()             -> { sidebarSections, noteWidth }
   <ExplorerPane sections>  <HomePage sections>
+  <NotePage noteWidth>
+    <div.note-page-layout data-note-width>
.note-page-layout { --note-measure: var(--note-measure-default); } /* 38rem, today */
[data-note-width="wide"]:not(:has(.note-editor)) { --note-measure: var(--note-measure-wide); } /* 48rem */
[data-note-width="full"] { max-width: none; }   /* Source loses its 1120px cap too */

The Help manual draws outside .note-page-layout, so it stays at Default.

Evidence

  • Before: the note column was always 608px (38rem), whatever the screen.
    After: a live pass against just dev-start picked each width in Settings and measured .note-content with no page reload. Light and dark gave the same numbers (px, 1440 / 2560):

    Width Reading Editor Source
    Default 608 / 608 608 / 608 809.6 / 1120
    Wide 768 / 768 768 / 768 809.6 / 1120
    Full 809.6 / 1929.6 809.6 / 1929.6 809.6 / 1929.6
  • New tests:

    • Each value round-trips through the settings file, and a value pinned in .env reads lower-cased or falls back to default, while an invalid save is refused.
    • The hook follows a save without a reload, keeps its cache and gives demo mode the default.
    • The note layout carries the width in Reading and Source.
    • The CSS ties each width to its token.
  • just check passed in full mode; palette.py passes.

Merge Danger

Door: two-way

The default is default, so no install changes until someone picks Wide or Full. Removing the setting later leaves a harmless unknown key in settings.json.

Blast Radius: note-layout

The only width rule that moves is .note-page-layout's. Wide tables and code blocks keep scrolling sideways. The Settings section is now titled Layout, and the manual, the changelog and .env.example are updated to match.

Closes #698

🤖 Generated with Claude Code

https://claude.ai/code/session_013rPDLf6kv5c7ndNho6mCJR

Settings section 02, renamed Layout, gains Note width: Default, Wide or
Full, saved as HATCHDOOR_NOTE_WIDTH and pinnable from .env like any live
setting. It caps the note column in the Reading view and the live
editor through new base.css tokens: Default is today's 38rem
(--note-measure-default), Wide 48rem (--note-measure-wide, about 100
characters a line), Full no cap. Source keeps its 1120px column unless
Full is picked, and Help's manual is drawn outside the layout, so it
stays at Default.

The server gains a choice kind: a pinned value reads lower-cased, one
that names no option reads as the first, and a save of anything else is
refused. The shell reads the width with the sidebar switches through
useLayoutSettings (sidebarSections.ts moved to layoutSettings.ts), so a
save or a return to the tab changes it without a reload, and NotePage
draws it as data-note-width.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013rPDLf6kv5c7ndNho6mCJR
@BattermanZ
BattermanZ merged commit 51064f9 into development Nov 14, 2026
@BattermanZ
BattermanZ deleted the feature/698-note-width branch November 14, 2026 08:26
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