Phone: text bar while typing; the bar never takes focus; sheets fit above the keyboard (#268) #280

Closed
kayg wants to merge 0 commits from issue/268-text-bar-2 into dev
Owner

Closes #268. (Replaces #272, which missed the editor.spec change at phone width.)

The bar follows kayg's rule on a phone.

  • Caret in the text: the bar is the text bar (Text ▾, B, I, S, code, highlight, link), sitting on the keyboard.
  • Keyboard down, or blocks selected: the note tools (Log, Insert, Style, Info, Source), or the block bar when blocks are selected. On a phone a note's screen now always has the tools when you're not typing.
  • B, I, S, code and highlight with just a caret start the mark right there (**|**). Pressing again on the empty pair takes it back.

Nothing in the bar takes focus from the text.

  • BottomBar has keepFocus: pointerdown and mousedown are prevented everywhere in the bar and its sheets. The only exception is a real field (search or link box), which needs typing.
  • Editor actions call view.focus() only when the editor has really lost focus (refocus in editing.svelte.ts). Focusing an already focused editor makes iOS move its keyboard.

Sheets fit what you can see. keyboard.svelte.ts sets --sheet-room: the visible height above the bar's bottom edge, minus the status bar. Phone sheets cap at it and scroll inside, so with the keyboard up the Style sheet ends above it.

Tests

  • e2e/bar-focus.spec.ts (new) runs at 390 and 430 with a faked keyboard, in Chromium (real taps) and WebKit (clicks: desktop WebKit has no tap-to-click):
    • every text-bar button is pressed, the editor keeps focus, there's never a focusin or focusout, and the marks really land in the text;
    • the Style sheet opens over the keyboard, fits above it, and none of its controls take focus.
  • e2e/viewport.ts: the fake keyboard, now shared with keyboard.spec.ts.
  • day.spec.ts, editor.spec.ts, keyboard.spec.ts and toast-bar.spec.ts now follow the new rule on a phone (the keyboard has to be down for the tools; keyboardDown in viewport.ts).

Already failing on dev, not from this PR: toast-bar's "carries on … on its own where there is none" fails at 390 on current dev (e324136) too. On a phone, deleting a note from Info lands on the list with no Undo toast. That's a regression from the train and needs its own issue.

🤖 Generated with Claude Code

Closes #268. (Replaces #272, which missed the editor.spec change at phone width.) **The bar follows kayg's rule on a phone.** - **Caret in the text:** the bar is the text bar (Text ▾, B, I, S, code, highlight, link), sitting on the keyboard. - **Keyboard down, or blocks selected:** the note tools (Log, Insert, Style, Info, Source), or the block bar when blocks are selected. On a phone a note's screen now always has the tools when you're not typing. - B, I, S, code and highlight with just a caret start the mark right there (`**|**`). Pressing again on the empty pair takes it back. **Nothing in the bar takes focus from the text.** - `BottomBar` has `keepFocus`: `pointerdown` and `mousedown` are prevented everywhere in the bar and its sheets. The only exception is a real field (search or link box), which needs typing. - Editor actions call `view.focus()` only when the editor has really lost focus (`refocus` in `editing.svelte.ts`). Focusing an already focused editor makes iOS move its keyboard. **Sheets fit what you can see.** `keyboard.svelte.ts` sets `--sheet-room`: the visible height above the bar's bottom edge, minus the status bar. Phone sheets cap at it and scroll inside, so with the keyboard up the Style sheet ends above it. **Tests** - `e2e/bar-focus.spec.ts` (new) runs at 390 and 430 with a faked keyboard, in Chromium (real taps) and WebKit (clicks: desktop WebKit has no tap-to-click): - every text-bar button is pressed, the editor keeps focus, there's never a `focusin` or `focusout`, and the marks really land in the text; - the Style sheet opens over the keyboard, fits above it, and none of its controls take focus. - `e2e/viewport.ts`: the fake keyboard, now shared with `keyboard.spec.ts`. - `day.spec.ts`, `editor.spec.ts`, `keyboard.spec.ts` and `toast-bar.spec.ts` now follow the new rule on a phone (the keyboard has to be down for the tools; `keyboardDown` in `viewport.ts`). **Already failing on dev, not from this PR:** toast-bar's "carries on … on its own where there is none" fails at 390 on current `dev` (e324136) too. On a phone, deleting a note from Info lands on the list with no Undo toast. That's a regression from the train and needs its own issue. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Phone: text bar while typing; the bar never takes focus; sheets fit above the keyboard (#268)
Some checks failed
CI / server (pull_request) Successful in 22s
CI / web (pull_request) Failing after 24s
CI / rust (pull_request) Successful in 1m53s
4c15a581b2
- Caret in the text on a phone: the bar is the text bar. The note tools
  (Log, Insert, Style, Info, Source) show when the keyboard is down, or
  blocks are selected.
- Nothing in the bar or its sheets takes focus from the text: presses keep
  focus (pointerdown and mousedown), and actions only refocus the editor if
  it really lost focus. Focusing an already focused editor made iOS move
  its keyboard.
- B, I, S, code and highlight with just a caret start the mark right there.
- Sheets are never taller than what you can see above the bar
  (--sheet-room from the visual viewport).
- e2e/bar-focus: with a faked keyboard, every text-bar button and the
  Style sheet's controls keep focus in the text; the sheet fits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018Yyy8fQGxPLkLa8v8NXz7T
e2e: on a phone, the note tools are there with the keyboard down (#268)
Some checks failed
CI / web (pull_request) Failing after 36s
CI / server (pull_request) Successful in 53s
CI / rust (pull_request) Successful in 1m33s
541d5bdacd
editor.spec and day.spec put the keyboard down before using the note tools
at phone width; keyboardDown lives in viewport.ts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018Yyy8fQGxPLkLa8v8NXz7T
Author
Owner

Landed in merge train #329.

Landed in merge train #329.
kayg closed this pull request 2026-10-14 17:39:17 +00:00
Some checks failed
CI / web (pull_request) Failing after 36s
CI / server (pull_request) Successful in 53s
CI / rust (pull_request) Successful in 1m33s

Pull request closed

Sign in to join this conversation.
No reviewers
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!280
No description provided.