From 07dae870f78d753e369ba73dedf02b064111cdc1 Mon Sep 17 00:00:00 2001 From: hl-valdemar Date: Mon, 19 Oct 2026 20:52:29 +0200 Subject: [PATCH] style: reduce note editor text size --- README.md | 2 +- Sources/Conjure/NotesController.swift | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 58310a2..9f2bda5 100644 --- a/README.md +++ b/README.md @@ -139,7 +139,7 @@ Commands explicitly declare `Application.Command.presentsView`. The shared dispa Search for **Conjure Notes**, identified by its centered 📔 icon, or assign it a global shortcut in Settings. Notes starts with a compact 570 × 404 layout inspired by Raycast Notes, with rounded corners and a centered muted note title, while using Conjure’s shared warm gradient background, cream text, and amber list markers and caret. Drag a window edge or corner to resize it; Notes remembers its size across reopening and app restarts, independently of other launcher views. The minimum size is 570 × 260, and restored dimensions fit the current screen’s visible area. The title bar offers Close, **Actions** (⌘), **Browse Notes** (note icon), and **New Note** (+). Browse Notes (Command-P) opens Conjure’s styled, scrollable searchable picker below the title bar, shared with translation language selection—not a native menu. Fuzzy-search note titles, then select with Up/Down, Control-J/K, and Return or by clicking a note. A checkmark marks the current note, which is selected and scrolled into view on opening. Reopening Notes restores the last selection. Each note’s first nonempty line becomes its title; duplicate titles remain independently selectable. -Notes uses a standard macOS window with system-inherited appearance and only the native Close button visible; minimize and zoom are hidden. The editor uses monospaced text, including Markdown headings, bold, and italic, while retaining Conjure’s warm palette. Heading sizes decrease from H1 through H6 (28, 25, 23, 21, 19, and 17 points); inline emphasis retains the heading’s size, and fenced code is not treated as headings. Closing still saves first and keeps the window open if saving fails. Other launcher views remain borderless with their existing dark appearance. +Notes uses a standard macOS window with system-inherited appearance and only the native Close button visible; minimize and zoom are hidden. The editor uses 15-point monospaced body text, including bold, italic, and code, while retaining Conjure’s warm palette. Heading sizes decrease from H1 through H6 (26, 23, 21, 19, 17, and 15 points); inline emphasis retains the heading’s size, and fenced code is not treated as headings. Closing still saves first and keeps the window open if saving fails. Other launcher views remain borderless with their existing dark appearance. Actions (Command-K) opens the same searchable popup style used throughout Conjure, with **Browse Notes** (Command-P), **New Note** (Command-N), and **Delete Note**. Delete Note asks for confirmation before permanently deleting the currently selected note and its embedded images. Delete is focused by default: Return confirms and Escape cancels; deletion cannot be undone. After deletion, Notes selects a remaining note or creates a fresh blank note if none remain. Save or deletion failures preserve the current note and editor buffer. Command-N creates a note while the editor or either popup is focused. Command-P toggles Browse Notes even while its title-bar controls are covered. Escape or clicking outside closes an open popup and returns focus to the editor without leaving Notes; another Escape dismisses the launcher. Control-J/K navigates only while a popup is open, preserving normal editor commands when it is closed. diff --git a/Sources/Conjure/NotesController.swift b/Sources/Conjure/NotesController.swift index 7d90f93..5775fc7 100644 --- a/Sources/Conjure/NotesController.swift +++ b/Sources/Conjure/NotesController.swift @@ -4,7 +4,7 @@ import Highlighter @MainActor enum NotesAppearance { - static let font = NSFont.monospacedSystemFont(ofSize: 17, weight: .regular) + static let font = NSFont.monospacedSystemFont(ofSize: 15, weight: .regular) static let paragraph: NSParagraphStyle = { let style = NSMutableParagraphStyle() style.lineSpacing = 5 @@ -624,20 +624,20 @@ enum MarkdownHighlighting { static let hiddenMarkup = NSAttributedString.Key("Conjure.hiddenMarkup") private static let inlineCode = try! NSRegularExpression(pattern: "(?`+)(?[^`\\n]+)\\k(?!`)") private static let rules: [(NSRegularExpression, [NSAttributedString.Key: Any])] = [ - (try! NSRegularExpression(pattern: "(?\\*{2,3}|_{2,3})(?\\S(?:[^\\n]*?\\S)?)\\k(?![*_])"), [.font: NSFont.monospacedSystemFont(ofSize: 17, weight: .bold)]), + (try! NSRegularExpression(pattern: "(?\\*{2,3}|_{2,3})(?\\S(?:[^\\n]*?\\S)?)\\k(?![*_])"), [.font: NSFont.monospacedSystemFont(ofSize: NotesAppearance.font.pointSize, weight: .bold)]), (try! NSRegularExpression(pattern: "(?[*_])(?[^\\s*_](?:[^*_\\n]*?[^\\s*_])?)\\k(?![*_])"), [.font: NSFontManager.shared.convert(NotesAppearance.font, toHaveTrait: .italicFontMask)]), (try! NSRegularExpression(pattern: "(?[^\\]\\n]+)\\]\\([^\\n)]+\\)|(?m)^\\s*(?:[-+*]|[0-9]+\\.)\\s"), [.foregroundColor: SunsetPalette.accent]), (try! NSRegularExpression(pattern: "(?\\S(?:[^\\n]*?\\S)?)~~"), [.strikethroughStyle: NSUnderlineStyle.single.rawValue]), (try! NSRegularExpression(pattern: "(?m)^(?:>[ \\t]*)+(?[^\\n]+)"), [:]), ] private static let heading = try! NSRegularExpression(pattern: "(?m)^(#{1,6}) (?.+)$") - private static let headingFonts = [28.0, 25, 23, 21, 19, 17].map { - NSFont.monospacedSystemFont(ofSize: $0, weight: .semibold) + private static let headingFonts = [11.0, 8, 6, 4, 2, 0].map { + NSFont.monospacedSystemFont(ofSize: NotesAppearance.font.pointSize + $0, weight: .semibold) } private static let highlighter: Highlighter = { guard let value = Highlighter() else { preconditionFailure("Missing bundled syntax highlighter") } - value.setTheme("atom-one-dark", withFont: "Menlo-Regular", ofSize: 17) + value.setTheme("atom-one-dark", withFont: "Menlo-Regular", ofSize: NotesAppearance.font.pointSize) return value }() private static let openingFence = try! NSRegularExpression(pattern: "(?m)^ {0,3}(`{3,}|~{3,})([^\\r\\n]*)\\r?\\n") @@ -732,7 +732,7 @@ enum MarkdownHighlighting { storage.addAttribute(hiddenMarkup, value: true, range: NSRange(location: NSMaxRange(block.body), length: NSMaxRange(block.range) - NSMaxRange(block.body))) } - storage.addAttributes([.font: NSFont.monospacedSystemFont(ofSize: 17, weight: .regular), + storage.addAttributes([.font: NotesAppearance.font, .foregroundColor: SunsetPalette.secondaryText], range: block.range) storage.addAttribute(.foregroundColor, value: SunsetPalette.text, range: block.body) let code = (text as NSString).substring(with: block.body)