Phone: text bar while typing, block bar otherwise; the bar never makes the keyboard jump #268

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

kayg on an iPhone 16 Pro Max (build e324136); screenshot below.

Problems:

  1. With the caret in text (text editing), the bar shows the note/block tools (Log, Insert, Style, Info, Source) instead of the text formatting bar.
  2. Tapping options inside the bar or its sheets takes focus away from the editor and gives it back. iOS then thinks the input moved, so the keyboard jumps up and down constantly, even though the caret stays.
  3. Sheets that open from the bar while the keyboard is up overflow the visible screen. On smaller phones it's worse.

Rule (kayg):

  • Caret in text (text mode): the bar is the text formatting bar (bold, italic, strike, code, link, heading level, list types, highlight, ⋯).
  • Blocks selected, or nothing focused: the bar is the block/note toolbar (Log, Insert, Style, Info, Source; block actions when blocks are selected).

With this split, the bigger sheets (Style, Info, Insert) only open when the keyboard is down, so they always fit the screen.

Also required:

  • Nothing in the bar ever steals focus from the editor: pointerdown preventDefault, no focusable elements that blur the contenteditable, and formatting applied through the editor view.
  • The keyboard must not move at all while you use the text bar.
  • Any input that genuinely needs the keyboard (link URL, search) runs in a sheet sized to the visual viewport.
  • Test: a Playwright WebKit test with a fake visualViewport that taps every bar button while the keyboard is up, and asserts the editor keeps focus and the viewport doesn't change.
  • Phone check for kayg: type, tap B / I / heading / list, and the keyboard never moves.

Related: #145 (keyboard docking), #257 (inset sheets), #208 (block mode).

kayg on an iPhone 16 Pro Max (build e324136); screenshot below. **Problems:** 1. With the caret in text (text editing), the bar shows the note/block tools (Log, Insert, Style, Info, Source) instead of the text formatting bar. 2. Tapping options inside the bar or its sheets takes focus away from the editor and gives it back. iOS then thinks the input moved, so **the keyboard jumps up and down** constantly, even though the caret stays. 3. Sheets that open from the bar while the keyboard is up overflow the visible screen. On smaller phones it's worse. **Rule (kayg):** - **Caret in text (text mode):** the bar is the **text formatting bar** (bold, italic, strike, code, link, heading level, list types, highlight, ⋯). - **Blocks selected, or nothing focused:** the bar is the **block/note toolbar** (Log, Insert, Style, Info, Source; block actions when blocks are selected). With this split, the bigger sheets (Style, Info, Insert) only open when the keyboard is down, so they always fit the screen. **Also required:** - Nothing in the bar ever steals focus from the editor: `pointerdown` preventDefault, no focusable elements that blur the contenteditable, and formatting applied through the editor view. - The keyboard must not move at all while you use the text bar. - Any input that genuinely needs the keyboard (link URL, search) runs in a sheet sized to the visual viewport. - **Test:** a Playwright WebKit test with a fake visualViewport that taps every bar button while the keyboard is up, and asserts the editor keeps focus and the viewport doesn't change. - **Phone check for kayg:** type, tap B / I / heading / list, and the keyboard never moves. Related: #145 (keyboard docking), #257 (inset sheets), #208 (block mode).
Author
Owner

![](https://git.kayg.org/attachments/df7e790a-7990-432a-8a6e-be19d7a0b3ea)
Author
Owner

PR #272. Screenshots from the e2e harness, light. The keyboard is faked through visualViewport, so it isn't drawn: it would cover everything below the bar.

390: keyboard down (note tools), then typing (text bar on the keyboard), then Style opened over the keyboard (it fits above it)
chromium-390-tools.png chromium-390-typing.png chromium-390-style-on-keyboard.png

430: the same three
chromium-430-tools.png chromium-430-typing.png chromium-430-style-on-keyboard.png

WebKit 390 / 430: typing
webkit-390-typing.png webkit-430-typing.png

The test (e2e/bar-focus.spec.ts) presses every text-bar button and every control in the Style sheet with the keyboard up. The editor never gets a single focusout or focusin. That's what makes iOS move its keyboard. It passes in Chromium and WebKit at 390 and 430.


Phone checklist for kayg (#268). Use the preview build in Safari and in the installed app.

  1. Open today's note and tap into the text. The bar above the keyboard is the text bar (Text, B, I, S, </>, highlight, link), not Log/Insert/Style/Info.
  2. Type a word, then tap B, I, S, </> and highlight one after another. The keyboard doesn't move at all, the caret stays put, and you keep typing into the mark.
  3. Select a word and tap B. It becomes bold, and the keyboard stays still.
  4. Tap Text ▾. The Style sheet opens above the keyboard and fits on the screen; scroll inside it if it's long. Tap Title, a list type and a colour. The keyboard never drops and comes back. Close it.
  5. Tap ✓ above the keyboard. The bar becomes the note tools (Log, Insert, Style, Info, Source). Tap Insert and Info: the sheets fit the screen.
  6. Select a block (tap its handle). You get the block bar with the keyboard down.
  7. Do 2 and 4 again on the smallest phone you have, and in the installed app.
PR #272. Screenshots from the e2e harness, light. The keyboard is faked through `visualViewport`, so it isn't drawn: it would cover everything below the bar. **390:** keyboard down (note tools), then typing (text bar on the keyboard), then Style opened over the keyboard (it fits above it) ![chromium-390-tools.png](https://git.kayg.org/attachments/fb96d904-295f-41bc-b882-03e3b5167c96) ![chromium-390-typing.png](https://git.kayg.org/attachments/339aab57-3f07-4f9e-9e9f-5ce67ff76a0b) ![chromium-390-style-on-keyboard.png](https://git.kayg.org/attachments/00916d1f-936e-4ea4-beff-2fa3ae2d1e5d) **430:** the same three ![chromium-430-tools.png](https://git.kayg.org/attachments/d36bc693-d29b-48f9-9b17-3022b2b79f6a) ![chromium-430-typing.png](https://git.kayg.org/attachments/19923b57-bfe9-4d88-8e29-1016e40b1628) ![chromium-430-style-on-keyboard.png](https://git.kayg.org/attachments/76bb07d7-ecdf-4854-9421-e91358eff482) **WebKit 390 / 430:** typing ![webkit-390-typing.png](https://git.kayg.org/attachments/0c57f24e-e34e-41f8-ace9-467770444644) ![webkit-430-typing.png](https://git.kayg.org/attachments/b3fdc2f0-6bd3-4176-8244-842a32bc8f7b) The test (`e2e/bar-focus.spec.ts`) presses every text-bar button and every control in the Style sheet with the keyboard up. The editor never gets a single `focusout` or `focusin`. That's what makes iOS move its keyboard. It passes in Chromium and WebKit at 390 and 430. --- **Phone checklist for kayg (#268).** Use the preview build in Safari and in the installed app. 1. Open today's note and tap into the text. The bar above the keyboard is the **text bar** (Text, B, I, S, `</>`, highlight, link), not Log/Insert/Style/Info. 2. Type a word, then tap **B**, **I**, **S**, `</>` and highlight one after another. **The keyboard doesn't move at all**, the caret stays put, and you keep typing into the mark. 3. Select a word and tap B. It becomes bold, and the keyboard stays still. 4. Tap **Text ▾**. The Style sheet opens above the keyboard and fits on the screen; scroll inside it if it's long. Tap Title, a list type and a colour. The keyboard never drops and comes back. Close it. 5. Tap ✓ above the keyboard. The bar becomes the note tools (Log, Insert, Style, Info, Source). Tap Insert and Info: the sheets fit the screen. 6. Select a block (tap its handle). You get the block bar with the keyboard down. 7. Do 2 and 4 again on the smallest phone you have, and in the installed app.
kayg closed this issue 2026-10-14 17:39:30 +00:00
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#268
No description provided.