Editor look: animated context menu; Wide works in Card mode; monospace source mode; --- splits cards #155

Closed
opened 2026-10-14 06:13:51 +00:00 by kayg · 2 comments
Owner

kayg, 2026-10-14, on calternal.cloud:

  1. Right-click menu: "please animate the right click action? it sounds too jarring?"
    • It grows from the pointer: a short spring on scale (about 0.96 to 1), with opacity and a slight blur, transform-origin at the click point, under 200 ms. Closing is quicker.
    • The submenu ("Turn into ›") opens the same way, from its row.
    • Keyboard-opened menus (the ⋯ key or Shift+F10) don't animate.
  2. Card mode: "in card mode, wide pages does nothing?" The Wide page toggle must widen the card too. Check every combination of Page/Card × Wide × phone.
  3. Raw markdown (source) mode: "should show markdown yes but also turn the font into monospace please." Source mode uses Maple Mono for the whole note, title included, with the same size rhythm. The font switch must not move the caret or the scroll position.
  4. --- in card mode: "adding a --- disappears into the void? whereas it should automatically split the one card into two?"
    • Card mode: each --- (thematic break) splits the note into stacked cards, with a gap showing the backdrop between them.
    • Page mode: --- draws a calm divider line.
    • Both: the markdown stays ---. With the caret on the line, the --- shows (hidden-syntax rules). No layout jump when the split appears.

(Fading in a note opened with the mouse goes with #150.)

kayg, 2026-10-14, on calternal.cloud: 1. **Right-click menu:** "please animate the right click action? it sounds too jarring?" - It grows from the pointer: a short spring on scale (about 0.96 to 1), with opacity and a slight blur, transform-origin at the click point, under 200 ms. Closing is quicker. - The submenu ("Turn into ›") opens the same way, from its row. - Keyboard-opened menus (the ⋯ key or Shift+F10) don't animate. 2. **Card mode:** "in card mode, wide pages does nothing?" The Wide page toggle must widen the card too. Check every combination of Page/Card × Wide × phone. 3. **Raw markdown (source) mode:** "should show markdown yes but also turn the font into monospace please." Source mode uses Maple Mono for the whole note, title included, with the same size rhythm. The font switch must not move the caret or the scroll position. 4. **`---` in card mode:** "adding a --- disappears into the void? whereas it should automatically split the one card into two?" - **Card mode:** each `---` (thematic break) splits the note into stacked cards, with a gap showing the backdrop between them. - **Page mode:** `---` draws a calm divider line. - **Both:** the markdown stays `---`. With the caret on the line, the `---` shows (hidden-syntax rules). No layout jump when the split appears. (Fading in a note opened with the mouse goes with #150.)
Author
Owner

Evidence for PR #252 (replaces #233). Real server and engine, production build. Machine load was 60–115 the whole time, so wall-clock timings below are noisy; counts are not.

1. Context menu: grows from the pointer

Frames with the animations frozen at 0 / 20 / 40 / 60 / 90 / 120 / 200 ms. Scale 0.96 → 1 on a spring squeezed into 200 ms, a 140 ms fade, 3 px of blur clearing; origin is the click point.

Chromium
https://git.kayg.org/attachments/5b1c2406-f501-428d-8757-b5a75989bb17

WebKit
https://git.kayg.org/attachments/2d663c25-c80a-4bc5-bd7e-b67a6f94f60a

"Turn into ›" grows from its row (0 / 40 / 90 / 200 ms):
https://git.kayg.org/attachments/96a87ce8-051f-4162-ac0f-c3e0dbc735e4

Opened with Shift+F10, the menu has 0 running animations (Chromium; e2e width.spec.ts). WebKit doesn't send a context-menu event for Shift+F10.

The menu over the photo backdrop (the #172 note). Its surface is now 88% paper over the glass. Chromium light/dark, then WebKit light/dark:
https://git.kayg.org/attachments/3c914e89-c8d8-4d96-b10a-681ff5b6c535

2. Width: Narrow / Wide / Full, with two --- breaks

The pointer is over "Second part" so the handle and → ⋯ show; they sit inside the card. On phone widths a floating card has no room for them, so they're hidden there.

Narrow, Chromium 320 / 390, light and dark:
https://git.kayg.org/attachments/416aaec8-9899-43ad-981b-78645a524454
Narrow, 900 / 1440:
https://git.kayg.org/attachments/ef575ca6-c8c7-460c-9a71-540e25f90f66

Wide, 320 / 390:
https://git.kayg.org/attachments/cf20e07d-9043-4ca2-aafd-deb2c7c67e98
Wide, 900 / 1440:
https://git.kayg.org/attachments/8a81cd6f-ef8a-41d0-980c-7adbafe81ab7

Full (the old Page look; --- is a divider), 320 / 390:
https://git.kayg.org/attachments/a03c1805-5f19-4bcd-be3e-b5fb5be316ac
Full, 900 / 1440:
https://git.kayg.org/attachments/e2bd6e1c-a7fe-4e77-9c52-3c15e3485b67

With the panes showing at 1440 there's only room for about 870 px, so Narrow and Wide look the same there. In Focus they differ (Narrow / Wide / Full):
https://git.kayg.org/attachments/caae7873-de4c-4503-8295-c490193d775f
https://git.kayg.org/attachments/4e6e5b56-1cbd-44fe-afb3-d91dfabc9202

WebKit, 390 / 1440, light and dark. Narrow, Wide, Full:
https://git.kayg.org/attachments/69373834-3213-4876-a9c0-ea363d71f301
https://git.kayg.org/attachments/ae59b2c9-5f73-4406-af95-c2ebee10866f
https://git.kayg.org/attachments/427e876c-d1f3-45e7-b143-fb70d1e8cbcf

The spring when you click a width (frozen at 0 / 60 / 120 / 200 ms, then settled). Narrow → Wide: the card grows in place and the text rewraps once, at the end.
https://git.kayg.org/attachments/589b5977-3b1b-4951-8782-970f522eb781
Wide → Narrow: the text narrows first, then the card follows.
https://git.kayg.org/attachments/58c5c13e-31cc-42e5-aebc-a2de59bae956

3. Opacity bug: the cause, and how it looks now

Cause: below 100% the shell masks the frame's glass down to a ring around the page, which is right for a page. In Card, though, the visible surface was that glass, so it vanished at 99%. The card's own paper was a fixed var(--paper), and .page.card forced --page-bg: transparent, so the slider had nothing left to change. Now opacity and blur act on the paper itself, with a 40% floor.

Old Card note at 99% (it opens as Narrow), Narrow at 60%, Full at 60%:
https://git.kayg.org/attachments/2f33749f-86c2-4f1c-981b-f0ee912fcade

4. --- typed under a line of text

Narrow with the caret still on --- (it shows, muted, and the cards are already split), then after typing on. Then the same two steps at Full:
https://git.kayg.org/attachments/dc421de5-af50-4b6c-a2f5-a4ac40c9221c
The file reads A paragraph of words.\n\n---\nNext card.. The blank line goes in automatically, so --- stays a break rather than turning the line above into a heading.

5. Source mode in Maple Mono

Before and after the switch:
https://git.kayg.org/attachments/65c4aba2-b6c4-447c-8c65-0a7976b58836
The caret's line stays at the same y. E2e checks this in 4 projects, to within 1 px, on a long note. On a note too short to scroll, the revealed frontmatter has to push the text down, because there's no room to scroll it back.

Performance

Typing cost per keystroke (CDP counters, 88 keys into the middle of a 200-paragraph note with 10 breaks, Chromium 1440, Focus):

build width layouts / key style recalcs / key layout ms / key script ms / key
dev (before) Page 1.17 2.47 0.71 13
dev (before) Card 1.17 2.43 0.64 13
#252 Full 1.22 2.47 0.68 12
#252 Narrow 1.67 3.07 0.76 13

The cards layer reads nothing from the page while you type: card tops come from CodeMirror's height map, and across, CSS places the card. A card is redrawn only when its numbers change (1 redraw in 88 keys). The extra layout per key at Narrow is the layer's measure pass; layout time stays under 1 ms per key. The keystroke-to-paint @perf tests (including a new one for Full vs Narrow) gave seconds-long numbers at load 60–115 for both builds, so they don't mean anything here. They should be run on a quiet machine before merging.

Evidence for PR #252 (replaces #233). Real server and engine, production build. Machine load was 60–115 the whole time, so wall-clock timings below are noisy; counts are not. ### 1. Context menu: grows from the pointer Frames with the animations frozen at 0 / 20 / 40 / 60 / 90 / 120 / 200 ms. Scale 0.96 → 1 on a spring squeezed into 200 ms, a 140 ms fade, 3 px of blur clearing; origin is the click point. Chromium https://git.kayg.org/attachments/5b1c2406-f501-428d-8757-b5a75989bb17 WebKit https://git.kayg.org/attachments/2d663c25-c80a-4bc5-bd7e-b67a6f94f60a "Turn into ›" grows from its row (0 / 40 / 90 / 200 ms): https://git.kayg.org/attachments/96a87ce8-051f-4162-ac0f-c3e0dbc735e4 Opened with Shift+F10, the menu has 0 running animations (Chromium; e2e `width.spec.ts`). WebKit doesn't send a context-menu event for Shift+F10. **The menu over the photo backdrop** (the #172 note). Its surface is now 88% paper over the glass. Chromium light/dark, then WebKit light/dark: https://git.kayg.org/attachments/3c914e89-c8d8-4d96-b10a-681ff5b6c535 ### 2. Width: Narrow / Wide / Full, with two `---` breaks The pointer is over "Second part" so the handle and → ⋯ show; they sit inside the card. On phone widths a floating card has no room for them, so they're hidden there. **Narrow**, Chromium 320 / 390, light and dark: https://git.kayg.org/attachments/416aaec8-9899-43ad-981b-78645a524454 Narrow, 900 / 1440: https://git.kayg.org/attachments/ef575ca6-c8c7-460c-9a71-540e25f90f66 **Wide**, 320 / 390: https://git.kayg.org/attachments/cf20e07d-9043-4ca2-aafd-deb2c7c67e98 Wide, 900 / 1440: https://git.kayg.org/attachments/8a81cd6f-ef8a-41d0-980c-7adbafe81ab7 **Full** (the old Page look; `---` is a divider), 320 / 390: https://git.kayg.org/attachments/a03c1805-5f19-4bcd-be3e-b5fb5be316ac Full, 900 / 1440: https://git.kayg.org/attachments/e2bd6e1c-a7fe-4e77-9c52-3c15e3485b67 With the panes showing at 1440 there's only room for about 870 px, so Narrow and Wide look the same there. In Focus they differ (Narrow / Wide / Full): https://git.kayg.org/attachments/caae7873-de4c-4503-8295-c490193d775f https://git.kayg.org/attachments/4e6e5b56-1cbd-44fe-afb3-d91dfabc9202 WebKit, 390 / 1440, light and dark. Narrow, Wide, Full: https://git.kayg.org/attachments/69373834-3213-4876-a9c0-ea363d71f301 https://git.kayg.org/attachments/ae59b2c9-5f73-4406-af95-c2ebee10866f https://git.kayg.org/attachments/427e876c-d1f3-45e7-b143-fb70d1e8cbcf **The spring when you click a width** (frozen at 0 / 60 / 120 / 200 ms, then settled). Narrow → Wide: the card grows in place and the text rewraps once, at the end. https://git.kayg.org/attachments/589b5977-3b1b-4951-8782-970f522eb781 Wide → Narrow: the text narrows first, then the card follows. https://git.kayg.org/attachments/58c5c13e-31cc-42e5-aebc-a2de59bae956 ### 3. Opacity bug: the cause, and how it looks now Cause: below 100% the shell masks the frame's glass down to a ring around the page, which is right for a page. In Card, though, the visible surface *was* that glass, so it vanished at 99%. The card's own paper was a fixed `var(--paper)`, and `.page.card` forced `--page-bg: transparent`, so the slider had nothing left to change. Now opacity and blur act on the paper itself, with a 40% floor. Old Card note at 99% (it opens as Narrow), Narrow at 60%, Full at 60%: https://git.kayg.org/attachments/2f33749f-86c2-4f1c-981b-f0ee912fcade ### 4. `---` typed under a line of text Narrow with the caret still on `---` (it shows, muted, and the cards are already split), then after typing on. Then the same two steps at Full: https://git.kayg.org/attachments/dc421de5-af50-4b6c-a2f5-a4ac40c9221c The file reads `A paragraph of words.\n\n---\nNext card.`. The blank line goes in automatically, so `---` stays a break rather than turning the line above into a heading. ### 5. Source mode in Maple Mono Before and after the switch: https://git.kayg.org/attachments/65c4aba2-b6c4-447c-8c65-0a7976b58836 The caret's line stays at the same y. E2e checks this in 4 projects, to within 1 px, on a long note. On a note too short to scroll, the revealed frontmatter has to push the text down, because there's no room to scroll it back. ### Performance Typing cost per keystroke (CDP counters, 88 keys into the middle of a 200-paragraph note with 10 breaks, Chromium 1440, Focus): | build | width | layouts / key | style recalcs / key | layout ms / key | script ms / key | |---|---|---|---|---|---| | dev (before) | Page | 1.17 | 2.47 | 0.71 | 13 | | dev (before) | Card | 1.17 | 2.43 | 0.64 | 13 | | #252 | Full | 1.22 | 2.47 | 0.68 | 12 | | #252 | Narrow | 1.67 | 3.07 | 0.76 | 13 | The cards layer reads nothing from the page while you type: card tops come from CodeMirror's height map, and across, CSS places the card. A card is redrawn only when its numbers change (1 redraw in 88 keys). The extra layout per key at Narrow is the layer's measure pass; layout time stays under 1 ms per key. The keystroke-to-paint `@perf` tests (including a new one for Full vs Narrow) gave seconds-long numbers at load 60–115 for both builds, so they don't mean anything here. They should be run on a quiet machine before merging.
kayg closed this issue 2026-10-14 12:15:57 +00:00
Author
Owner

Decided (kayg, G13, 2026-10-14):

  • Phones have one width: the whole screen. The Width control (Narrow / Wide / Full) is hidden on phones, and a note's saved width is ignored there. A phone is already about one comfortable line of text, roughly 35–45 characters at the body size.
  • Tablet and wider (anything bigger than a phone) shows Narrow / Wide / Full. New notes default to Wide. Each note remembers its width.
**Decided (kayg, G13, 2026-10-14):** - **Phones have one width:** the whole screen. The Width control (Narrow / Wide / Full) is **hidden on phones**, and a note's saved width is ignored there. A phone is already about one comfortable line of text, roughly 35–45 characters at the body size. - **Tablet and wider** (anything bigger than a phone) shows Narrow / Wide / Full. **New notes default to Wide.** Each note remembers its width.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
kayg/calternal#155
No description provided.