Skip to content

iOS: keyboard redesign — Apple's keyboard on KeyboardKit, tap or hold to dictate - #315

Merged
alexkroman merged 55 commits into
mainfrom
feat/ios-keyboardkit
Nov 18, 2026
Merged

alexkroman merged 55 commits into
mainfrom
feat/ios-keyboardkit

Conversation

@nbisht-aai

@nbisht-aai nbisht-aai commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

What & why

The iPhone keyboard was hand-drawn: its own caps, geometry measured off Apple's keyboard by a probe, three layouts, a brand theme, three mic designs, and no callouts, delete-repeat, cursor drag, autocorrect or suggestion bar. This makes it Apple's keyboard one-to-one, plus Blurt's own, on KeyboardKit 11.1.6's free core — the native-look KeyboardView, Apple's English layout, callouts, gestures, clicks. Built on top of #311 (feat/ios-held-session); merge that first.

  • KeyboardKit as the iPhone app's one remote package, pinned exactVersion: 11.1.6: a closed-source binary (plus LicenseKit 2.4.1, also binary), fetched by SPM at build time and checksum-verified — nothing of it is checked in, no licence key, no Pro feature, no plugin product. The app links and embeds it; the keyboard imports it with link: false and loads the app's copy through @executable_path/../../Frameworks (confirmed on a build: the appex carries no Frameworks/, its debug dylib links @rpath/KeyboardKit.framework/KeyboardKit, the rpath is there). The "Sparkle is the only remote package" settled decision is rewritten: check.sh's guard is a per-spec allowlist that also rejects github: shorthand, floating version keys and a url not followed by exactVersion:; AGENTS.md, the guardrails skill, the iPhone README and CONTRIBUTING say the rule as it now stands, including the audit of the binary (links AVFAudio and AudioToolbox, names AVAudioSessionCategoryRecord for its dictation seam that Blurt never sets up, no capture or speech symbol).
  • The keyboard: KeyboardInputViewController + KeyboardView draw Apple's keyboard and own typing, shift/caps lock, the pages and the number pad, delete and its repeat, callouts, the space bar's cursor drag, clicks. Blurt keeps the mic (KeyboardAction.blurtMic, after space at the 123 key's size — Apple's own dictation mic sits in the host's bar below the keyboard, which no extension can draw into; MicKey is a plain glyph: mic.fill, the live waveform while recording, the clipboard, the exclamation mark), the bar above the keys (BlurtToolbar: status line, +/chip, the term field) in KeyboardKit's colours with only the signal green and notice orange left of the brand, the term field's keys, routed by BlurtActionHandler. The panel and bar layouts, the theme, the mic candidates, the gallery and their settings are gone.
  • Apple's geometry, in KeyboardKit's terms: KeyboardLayoutConfiguration.blurt is built from the measured tokens (cap 43 × row gap 11, key gap 6, side margin 6.667, radius 8, bottom margin 13); the bar is 44 pt with 8.667 pt under it, so the band above the first row is Apple's 52.667 pt and the keyboard its 270.667 pt. The mic and the 123 key are pinned to Apple's 43.333 pt cell, so every other cap keeps Apple's width.
  • Tokens: Design/tokens.json loses the 184 tokens only the hand-drawn keyboard read (the glass/classic/layout/voice/wave/popup/picker/surface/grille/ribs/streak metrics, the kb/* colours, the system-* faces and every theme role but signal and notice, Apple's and the material brand colours, the key-face type sizes, the sheen/glint/flip/landing/ring motion). Every token left is read by a view.
  • Verification: scripts/keyboard-parity.sh runs Apple's and Blurt's geometry probes on one simulator and diffs every key's frame and cap; scripts/ios-keyboard-flows.sh drives the one keyboard on both faces; KeyboardParityTests pins the layout with the mic against KeyboardLayout.standard and the band and keyboard height against the measured glass file; DESIGN.md's contract table gains "the bar" and "the mic's place".

Free core only (Neil, 2026-11-09): autocomplete/autocorrect, the emoji keyboard and themes are Pro (Business tier at AssemblyAI's revenue) and are out of scope.

The one thing that is not Apple's

iOS 26 insets a third-party keyboard's view 17 pt above and 17 pt below inside the host's glass container; Apple's own keyboard sits flush. So Blurt's container is 34 pt taller than Apple's and its rows sit 17 pt higher on the screen, with the same caps, gaps and bands. No extension can change the host's inset.

Since the first draft (tested on an iPhone 13, iOS 18.7.8)

  • The letters follow the case. The layout is rebuilt whenever KeyboardKit changes the case, page or locale (BlurtKeyboardView observes the context); before, a layout built once kept the uppercase letters it came up with and typed capitals.
  • Tap or hold to dictate, nothing waited for. Finger down starts. A tap's lift sends nothing and the next finger down stops the moment it lands. A hold (PressHandshake.defaultHoldThreshold 350 ms) is push-to-talk: the lift sends the stop the instant the finger is off the key. PressHandshake loses the old hold-on-lift-only rule.
  • The space bar moves the cursor after 0.15 s (motion/space-hold) instead of KeyboardKit's half second, on the space key alone — just past a tap, so a tap still types a space.
  • No animation on the keyboard's own parts. The mic key, the + and the bar change the instant the phase does: every fade, symbol transition and press animation is gone, with their tokens.

Merged with main. Delete after a dictation is an ordinary one-character delete: the one-tap undo and #297's "Delete whole dictation" switch are removed (Neil, 2026-11-13).

How it was tested

  • scripts/keyboard-parity.sh on the iPhone 17 simulator (iOS 26.5), both faces: every matched key within 0.5 pt of Apple's — letter 33.5, gap 6, side margin 6.667, height 43, shift 45.333, return 93, 123 and the mic 43.333, space 191.667 vs 191.333, radius 8.33 vs 8.17 (light) and 8.08 vs 8.08 (dark); the band above the keys 52.667 after the host's 17 pt inset. Screenshots of both keyboards side by side are in the run's output.

  • scripts/ios-keyboard-flows.sh, light and dark: 43 checks each, all green — the case (an empty field lifts the keys, the first letter drops them, a period lifts them again, shift lifts one), a hold's lift stopping the dictation — the mic present, ready and drawn; the mic on the bottom row's centre line between space and return; the + in the bar above the keys at its trailing end; letters typing into the host; the highlighted word's chip adding a key term in one tap; the + opening the term field with the keys typing into the field, not the host; a tap starting a dictation and a second tap stopping it; the globe switching away and back; the keyboard dismissed and brought back, the mic full size and drawn each time.

  • scripts/ios-test.sh: 365 iPhone tests, BlurtiOSCore line coverage 96.2 %; scripts/ios-check.sh green (swiftlint analyze, periphery, probe build).

  • scripts/check.sh --portable: dependency guard (with hand-run negatives: the KeyboardKit URL in the Mac spec, version:, github:), design-sync, jscpd 0 clones, invariants self-test, shellcheck/shfmt, markdownlint, whole-tree swift-format lint --strict and swiftlint.

  • On Neil's iPhone 13 (iOS 18.7.8): the keyboard in Messages, the case, the tap, the hold, the space bar.

  • scripts/check.sh passes (CI: run 43512598415 on 9cda764 — check, ios-build, both sanitizers, gate)

  • I read AGENTS.md and this doesn't reintroduce anything deliberately removed — the one settled decision it changes (remote packages) is rewritten in the same table, not worked around; check-invariants.sh --self-test passes

  • Docs updated: AGENTS.md, the guardrails skill, App/BlurtiOS/README.md (Dependencies), CONTRIBUTING.md, DESIGN.md (The mic's place, The mic key, The bar above the keys, the contract table)

🤖 Generated with Claude Code

nbisht-aai and others added 30 commits November 4, 2026 17:13
…rds, hop URLs

The records the app and the keyboard will exchange about the listening
window: one readiness record with a 15 s lease (never distantFuture), a
typed FailureReason, an ack per command, a presence record only its own
process may clear, and blurt://start?reason= / blurt://setup?need=. The
command and phase payloads gain their ids and reasons with defaults, so
every existing writer still compiles; SharedStore.isListening reads the
record when there is one and the old keys until then.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…iP keeper onto main

From feat/ios-pip-mic (park/startParked/hold, the first-frame wait, the
simulator source's scripted speech) and the proven proto/ios-pip-keeper
spike (the keeper). Nothing wires them yet: ListeningWindow still holds
the mic for the window. The debug API-key block returns for scripted
simulators; the digital-silence check gains its test row.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…ion-tokened state machine

Core, no clock, no audio, no store: the interpreter feeds it events
(open requested, opened, utterance edges, interruption, resume, expiry,
media reset, stop, closed, idle change) and carries out the effects it
answers with (session, source, expiry timer, background task, the
ListeningState record, a log line). The foreground gate lives in the
machine; open-while-open refreshes; the lifetime counts from the last
word with a dictation's start as the floor; an interruption keeps the
window and resumes on the interruption's end (poll) or the next
foreground (start); a failed resume stays interrupted; stale
generations are logged and dropped. Every publish bumps the sequence
and carries a real lease. 30 tests, one per row plus the record's
invariants over a whole life.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…rd command, and the owner-based release

CommandRouter.route decides one keyboard command from values alone (the command, the
ListeningState record, the coordinator's phase, the dictation in flight and its owner,
the keyboard on screen, the ids already answered): the CommandAck to write, the submit
to carry out (press / release / cancel), and whether to remember the id. A press is
never submitted to a window that is not open; a release or cancel is accepted from the
owner or from the keyboard on screen, and only for the dictation in flight.

OwnerWatchdog.shouldRelease ends a dictation whose owner's presence record is missing,
not on screen, or older than BlurtShared.ownerWatchdog (10 s); another keyboard on
screen does not keep it alive. A dictation with no owner on record is kept by whoever
is on screen.

Every row is a test: 26 in CommandRouterTests, 8 in OwnerWatchdogTests.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
… state machine

Every finger event, ack, phase, tick and readiness record comes in as an
Event; every send, gate reset, line and hop goes out as an Action for
KeyboardModel to perform. A press is answered by the ack or by a phase that
names it, resent once at 600 ms, given up at 1.2 s (gate reset, "unanswered",
the next lift hops — never a dead release). Owned, foreign and stopping each
have their rows; a hold lifted before the answer waits for the dictation's id
and releases at once. 33 tests, one per row.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…ery row tested

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…ccessors out, no force unwraps

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…ult injection

ListeningSourceFailure gains interrupted(reason), runtimeError(code), configureFailed(code),
inputSilent, couldNotResume and backgroundStartRefused(code), each its own sentence, and stays
Equatable. ListeningSource gains `events: AsyncStream<SourceEvent>` (interrupted,
interruptionEnded, runtimeError, routeChanged, silent). WindowedAudioSource registers the
session's runtimeError / wasInterrupted / interruptionEnded and the audio session's route
change on the control queue before the first startRunning, logs each (Capture, public) and
throws the typed case a start finds — never "No microphone is available." for a refusal; a
parked start left not running is backgroundStartRefused. UtteranceFeed keeps the 1 s silence
watchdog (DESIGN.md row), held off during a parked bring-up until the first live frame.
CaptureFailure maps every failure and event to the keyboard's FailureReason and a sentence.
SimulatorAudioSource takes BLURT_SIM_FAULT (README) and, for tests, runs with no Mac mic.
PCMConverter moves to its own file for the lint budget.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…eflight, install, launch, kill, pull, syslog

device-install.sh (the vault-side helper) moves into the repo as one script with
subcommands, all on `xcrun devicectl` and nothing else — no Xcode window, no
debugger:

- preflight: the phone is `available` (the list's State column, filtered, since
  the JSON carries no such field), Developer Mode on (`device info details`),
  unlocked since boot, Blurt's install state; then the checklist of what no
  script can see (UI Automation, the keyboard with Full Access, an API key).
  Exits non-zero naming what is missing.
- install: xcodegen under BLURT_TEAM, a Debug build for `id=<udid>` with
  automatic signing into a per-checkout derived-data directory, `devicectl
  device install app`.
- launch [args…]: `--terminate-existing`, default `-BlurtDeveloperMode YES`;
  the app's arguments go after `--` (devicectl reads `-Blurt…` as its own `-t`
  otherwise); a locked phone is reported plainly.
- kill blurt|keyboard: the pid by executable path from `device info
  processes`, then SIGKILL.
- pull DIR [--syslog] [--last 15m]: Library/Logs/Blurt from the app's data
  container (a missing folder — CoreDevice error 7000 — is not a failure), and
  with --syslog the phone's system log through `log collect --device-udid`
  under osascript's administrator-password dialog, the archive chown'd back.
- syslog ARCHIVE [--last 15m] [--negative]: Blurt's lines, the system daemons'
  lines about it and any background-start refusal, minus the usual noise; or
  the negative predicate every gate run asserts (no `start recording in the
  background` / 561145187 / `!rec` line naming Blurt), exit 1 with the lines.
- flows, check: stubs (exit 2) until DeviceFlows lands with the device gate.

README › Testing on a phone is now that protocol; AGENTS.md lists the script
in the repo map and the verification block.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…S generation, the slim bar's mic at W/2

KeyboardProfile (BlurtKeyboard) decides the generation once per appearance from the OS
(ProcessInfo, read in that one place), the width, the globe and the host's container inset read
from the input view's superview at viewIsAppearing: glass only on iOS 26+ with a container
detected, classic otherwise (iOS 18 phones, un-adopted iOS 26 hosts). It exposes the margins,
gaps, key height and corner, the band above the keys, the bottom inset and whether the surface is
painted; KeyGeometry lays the classic rows out as W/10 cells, KeyboardLayout.height takes the
profile, KeyboardRootView reads its margins and sets keyboardInContainer from it, KeyboardPalette
offers Apple's classic colours as the `system` theme (the store's default) on classic with the
brand one row away. The numbers are the `classic/*` and `glass/*` token sets in tokens.json; the
classic ones are the plan's fallback rule, marked unmeasured, because Xcode 27's downloader
refuses every iOS 18.x runtime (22G86, 22F77, 22E238) — apple-geometry.sh gained --profile, the
device-type scale and the os/runtime fields (ios-lib.sh: BLURT_SIM_RUNTIME, ios_device_scale) so
the classic-390 and classic-375 JSONs can replace the fallback on an iOS 18.6 simulator.

Same step: the slim bar places the mic in keyboard coordinates (centre = W/2, delete and return
hanging on its trailing side, inboard at an edge; SlimBarLayout, tested) and the probe's
placement check measures every layout against the keyboard's width; the panel's element is
capped at min(box, row − 2·(clearance + glyph hit)); FullKeyboardView is bottom-aligned in its
reader; the carousel's pages carry the side margin themselves; AZERTY's third row gains its
apostrophe; the Face ID bottom row (123 · space · return) is documented and tested at every width.

Tests: KeyboardProfileTests (generation, size class, every row adds up at 375/390/393/402/430 ×
both generations, the three profile JSONs), AppleGeometryTests over the three JSONs,
DesignTokensTests heights per profile and a modifier-contrast test (1.3 for the system set, 1.09
for the brand's quieter modifiers — 1.21/1.10 painted, 1.13/1.28 in the container — so neither
fades), VoiceRowLayoutTests at rows 362/377/389/417 and SlimBarLayoutTests.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
What the machine carries across transitions, each pinned by a test:
the closed record keeps its reason (the failed open's, the refusal's,
the cause's) across heartbeats; a hop while closing is remembered —
the closing record says opening (Cause.reopen) and closed(g) goes
straight to opening(g+1) with one openSource, a Stop meanwhile takes
it back; Event.windowMinutesChanged applies Settings live (an open
window's end moves from now, a dictation's floor holds, until-stopped
cancels the timer, any other state only stores it); a source lost
while opening lands opened in interrupted(resumable) with a background
task and the expiry scheduled; a refresh republishes the last
heartbeat's micLive (lastMicLive, true on opened and resumed); the
switch turned off while interrupted logs the same stopWhileInterrupted
line as Stop; openRequested documents inForeground as
applicationState != .background. The types move to +Types.swift and
the rig to +Rig.swift to keep every file under 400 lines. 46 tests.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
"In flight" means one thing for every row: a release or cancel with a terminal
phase acks nothingInFlight whatever ref was left, and only an in-flight phase
with a ref can be stopped or cancelled. The app never acks suspended: a lapsed
lease is answered from the window (reasonForPress). A resend is answered with
its original outcome — Input.seen becomes answered: [UUID: Outcome] — so the
keyboard's 600 ms resend sees started(d) again; Outcome.duplicate stays in the
contract, the router no longer produces it. An accepted release or cancel
carries recipient = the keyboard that sent it.

37 rows in CommandRouterTests (+Ending); BlurtiOSCore line coverage 93.87%.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
F1 a finger down over a latched dictation that ended unseen takes no press
   from a closed or lapsed window: unready(reason) + [resetGate, show], lift hops.
F2 foreign carries liftStops: false via ack busy (the tap's lift leaves it
   running, the next tap stops it), true via a finger down over a running one;
   a hold's lift always releases.
F3 ack stale/duplicate/nothingInFlight for the press keeps it waiting; the
   deadline settles it. An answer at or past the deadline is late, tick or not.
F4 Action.armGate: the one action on which the model arms the gate.
F5 cancelTapped is the × only; canUndoBeforeRecording + undoBeforeRecording(now:)
   for the flip — pressing and owned(connecting) cancel, a recording keeps its words.
F6 a lapsed lease or no record while owned/foreign/pressing → suspended, gate
   reset; a record merely not ready while owned keeps owned.
F7 a finger down or up over owned(processing) buzzes, nothing sent.
F8 the lift half moves to PressHandshake+Stop.swift; tests split likewise, a
   third suite for the gate and the record.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Input.heldError: the last .error snapshot KeyboardModel holds until the next
micDown; its row applies while the live snapshot is idle, so the line outlasts
the ring's 2 s dwell. Handshake gains .foreign (silent, like .owned); pressing
and stopping drop their since: payloads (the deadline is PressHandshake's).
Tap.none → Tap.buzz. Precedence pinned: a notice beats the handshake in every
state. The doc comment lists the signature deviation from the plan.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
… the status line and the hop

The keyboard's half of the session contract. KeyboardModel drives
PressHandshake for every finger event, signal and tick: a press goes out
with the process, controller, sequence and record it decided on, is resent
once and given up at its deadline; a lift stops with the dictation's id; a
refused or expired press hops with its reason (blurt://start?reason=, or
blurt://setup?need=fullAccess without Full Access). Presence is one
compare-and-written record per process, with the older keys kept for a
release; the host leaving or the keyboard leaving ends only a dictation it
owns; deinit detaches the model. VoiceRowHost holds the three-way switch
for the bar and the panel, with the status line under the element (on the
bar's bottom edge, where nothing fits under a 32 pt box in a 44 pt row).
The error's exclamation shows whether or not Blurt is ready. Tests:
gate/lifecycle/fuzz rewritten on the handshake, the rig writes the
ListeningState record and the old keys, the fuzz gains the ack, record,
deadline and host events and the handshake invariants; the large_tuple
in KeyboardProfileTests is a struct.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…ned and watched; PiP idle mode

The app side of the session contract, finished from the wip commit.

ListeningWindow is the interpreter of ListeningWindowMachine: injected source,
audio session (AudioSessionControlling, the Typeless options, haptics flag,
preferred input), background tasks, clock and idle mode, with production
defaults; one serial loop; the source's and the audio session's events as the
machine's events with the generation; expiry timer; 5 s heartbeat with micLive
from the idle mode; every transition logged and traced. HeldIdle and
PictureInPictureIdle (the proven keeper recipe, untouched; a parked start iOS
refuses is the source lost until the next foreground, never a counter, never a
closed window); -BlurtIdleMode held|pip; the keeper's layer hosted on RootView.

DictationCoordinator: start() writes ListeningState.launched; every keyboard
command goes through CommandRouter and is acked (resends answered the same,
32 ids kept); a press's dictation is owned and named on every phase with the
press it answers; OwnerWatchdog every keyboard beat and on the keyboard signal;
a release runs under a 25 s background task; the result goes to the keyboard
that sent the accepted stop, else the owner, re-signalled once at 1 s; every
capture failure is said in the source's words with a typed reason; the hop URLs
blurt://start?reason= and blurt://setup?need=fullAccess. The home card reads the
record; a failure dwells 3 s and clears on any window-state change. Settings:
window minutes applied live, "Use AirPods mic".

Tests: ListeningWindowTests over fakes and a manual clock, the coordinator's
ack path, ProtocolTests on the record, KeyboardRig.listening writing the
record, HomeStatus on the record, the silence watchdog's start grace.
DESIGN.md's two-processes table gains the window's rows; README the window's
launch arguments and log predicate.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…e — onto the app's window interpreter

Fixtures unified on the keyboard branch's KeyboardRig (launch, sequence, record, answer, latchRecording, capturingHops).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…UG_API_KEY) so a keyless simulator can open the window

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
F1 A press is never accepted by a closing window: the machine publishes the
   closing record before it ends the dictation and closes the source, and the
   coordinator routes commands on ListeningWindow.liveState (the machine's
   state this instant, ListeningWindowMachine.current) rather than the record
   last written.
F2 Idle-mode reports carry the generation they were made for; the window drops
   one for another generation ("stale idle report"); the keeper's park and
   hold tasks are cancelled by windowClosing and re-check after every await.
F3 The owner watchdog ticks every DictationCoordinator.watchdogTick (2 s)
   while a dictation is in flight, on the coordinator's clock, and stands down
   for a stop already accepted (stopAccepted): no double release.
F4 sessionInterrupted resets on every openSource and on resumed(g), so a Stop
   during a call does not drop the next window's capture-session interruption.
F5 The heartbeat runs from ListeningWindow.start() for as long as the process
   lives, in every window state: the machine's heartbeat while a window
   exists, ListeningState.renewed (through heartbeat(renewing:now:), so the
   sequence keeps climbing) while closed. A closed window reads sessionOff on
   the keyboard, never suspended, while the app is alive.
F6 A hop over an interrupted PiP window awaits windowClosing(), which waits
   for the keeper's didStop (PictureInPictureIdle.keeperStopWait, 1 s) before
   the next source opens; windowOpened never parks under a keeper that is
   stopping, and a start wanted while stopping runs on didStop.
F7 SystemBackgroundTasks' expiration handler ends the task synchronously on
   the main actor; the 25 s own timer stays.
F8 Coordinator tests over the real session with a stub transcript: the
   accepted press and its phases, the owner's release and the result's
   address, a stranger's release, the watchdog (and not after an accepted
   stop), a resend, a press during a close.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
DESIGN.md › The two processes: the keyboard's rows (press and stop acks,
the retry, the keyboard beat and presence record, leaving with a stop
out, the hop reasons, the status line and its strings, the held error,
the line's place, the log subsystem) with every number a named constant,
and a marked place for the app side's rows; SessionContractNumbersTests
pins each row's constant and greps the table for it. The keyboard's
Container logger and the app's HostIdentity share BlurtShared.logSubsystem.
A keyboard leaving with its own release out keeps its presence record on
screen until the ack or KeyboardModel.leaveGrace, so the watchdog never
releases the same dictation a second time. The bar's status line takes
the row's bottom text line at size/line and the row draws in the band
above it, so the grille sits clear of the words; the panel's line hangs a
gap under the box. The fuzz invariant names the handshake's states and
recovers() walks a dead app: lease lapse → suspended → the tap hops.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
A dictation that caught no words comes back with an empty transcript and a
rewrite the model wrote from the style instruction alone; on the phone that
pasted the instruction's own words. The choice is now a pure function with
a test: no spoken words, nothing pasted.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…nstruction back

The rewrite model answers a transcript its cleanup rules empty out ("Yeah.")
with the tail of its own instruction — the user's style preferences, word
for word — and a lone "Um." with ".": 6/6 each against the route on
2026-11-05, under every ordering of the instruction tried, llm_error null.
On the phone the style text was pasted as a dictation. `RewriteGrounding`
keeps a rewrite only when it says something and is not a run of the
instruction the request carried; `chooseTranscript` falls back to the
verbatim transcript otherwise. The choice and its tests move to sibling
files (file length).

ios: `-BlurtDeveloperMode` / `-BlurtDeviceTrace` outlive their process
(`LaunchFlags`): the hop's relaunch carried neither, so the dictation log
and the trace stopped at the first hop. `ios-device.sh launch` passes both
by default.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
… the keyboard and the tests

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…t URL, the app returns to it once the window is open

The keyboard reads the app it is up in off its controller (`HostApp`,
`_hostBundleID`, read only where a getter or ivar is declared) and puts it
on `blurt://start?reason=…&host=…`. The app holds it (`returnHost`) and,
on the first record that says open with the mic staying live — at once
under a held mic, on the keeper's `pip` report, or `BlurtShared.hopReturnCap`
1.5 s past the open — asks iOS for the host (`HostReturn`,
`LSApplicationWorkspace openApplicationWithBundleID:`, as Typeless does)
and leaves. A window closing before it opened, or the user leaving first,
cancels it; no host, or the call refused, leaves the "◀" hint as before.
`ListeningWindow.onRecord` reports every record; `DictationCoordinator`
takes `appState` and `hostReturner` for the tests.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Port the Blurt-is-on screen from feat/ios-keep-open as the card iOS shows
for Blurt in the app switcher. RootView fades KeepOpenView over the app
whenever the scene leaves the front with a listening window on, and out
again as it returns, so the card — and the snapshot iOS keeps — says to
keep Blurt in the background and for how long it listens. The words are
KeepOpen and the DVD screensaver is Bounce, both in Core and tested; no
close, no stop, no swipe hint: the scene is inactive whenever it shows.
Tokens for the tints, the bounce, the flare and the fade; Wordmark takes a
height and a tint; -BlurtKeepOpen renders it as the root for a capture.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
var last: Corner?
let wallsX = x.hits(x.distance(drift))
guard wallsX > 0 else { return (0, nil) }
for wallX in 1...wallsX {

@aikido-pr-checks aikido-pr-checks Bot Nov 10, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cornersHit rescans every x-wall hit on each animation frame, so work per frame grows with elapsed time. Track new corner hits incrementally or compute only the relevant hits.

Suggested change
for wallX in 1...wallsX {
let firstWallX = max(1, wallsX - 1)
for wallX in firstWallX...wallsX {
Details

✨ AI Reasoning
​The animation computes a frame from absolute time, and cornersHit(byDrift:) scans from the first wall hit on every frame. As time advances, that range grows, so later frames do increasingly more work and the total work across an animation grows quadratically. Track corner hits incrementally or compute the relevant hits directly instead of rescanning the full history.

Reply on this comment to give feedback or ignore the issue.
More info

nbisht-aai and others added 5 commits November 10, 2026 11:46
…thin 0.5 pt of Apple's on the parity run

`KeyboardLayoutConfiguration.blurt` is Apple's keyboard's own numbers, as the probe measured them
(`key/height` 43, `row/gap` 11, `key/gap` 6, `margin/side` 6.5, `margin/bottom-keys` 13,
`key/radius` 8), in KeyboardKit's terms: a row is the cap and the gap under it, a cell the cap
and half a gap each side, the edges what the margins leave past those half gaps. The standard
rows are rebuilt on it; the 123 key and the mic are pinned to Apple's measured width
(`key/abc-width-402`, scaled with the keyboard); every cap takes the fitted radius; the bar is
Apple's suggestion bar's height (`voicebar/height` 44).

`scripts/keyboard-parity.sh` now reads the caps off both screenshots with design-diff.swift
measure — XCUITest's cells are touch targets, tiled with no gaps and not centred on Apple's caps
— and judges those: on the iPhone 17 simulator (iOS 26.5, 402 pt) letter 33.5, gap 6, margin
6.667, height 43, shift 45.333, return 93, 123 and the mic 43.333 are Apple's to the third
decimal; the radius reads 8.33 against 8.17, space 191.667 against 191.333; the fills are one
level off (#FEFEFE / #585858). Where the keyboard sits is shown, not judged: iOS 26 insets a
third-party keyboard's view 17 pt inside the host's glass container, above and below, where
Apple's own sits flush, so Blurt's rows stand 17 pt higher and its container is 34 pt taller
— the host's, not the keyboard's. The probe's records keep the `button:` names apple-geometry.sh
reads.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
… read KeyboardKit's keys, CI lint fixes, docs

The flows failed to find the mic: KeyboardKit names a custom key after its
action and drops the content's identifier, so the accessibility label, value
and identifier go on the key in the buttonView builder. The flows query
app.keys for the mic, letters, space and return (the keyboard-key trait),
read the bar's place off the top letter row, and compare the host's text
before and after typing a term (the old substring check matched the field's
own word).

CI: a 127-column signature; swiftlint analyze's unused imports (SwiftUI in
the controller; CoreGraphics in the touch rule, which now uses Double so it
imports nothing); periphery's unused test parameters.

Docs: DESIGN.md's prose for the mic's place, the mic key and the bar above
the keys; README; the geometry resources' comment; apple-geometry.sh's
header; the cleanup reviewer's dormant-code list.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…d; the bar and the mic's place in the contract

Design/tokens.json loses 184 tokens no view reads since the keyboard became
KeyboardKit's: the glass/classic/layout/voice/wave/popup/picker/surface/
grille/ribs/streak metrics, the kb/* colours, the system-* faces and every
theme role but signal and notice, Apple's and the material brand colours,
the key-face type sizes and the sheen/glint/flip/landing/ring motion. The
kept keyboard metrics say what KeyboardKit reads them as; margin/vertical
is 8.667 so the bar (44) and the margin make Apple's 52.667 pt band above
the keys and the keyboard its 270.667 pt. The generator's themes table has
the two roles left.

DESIGN.md's contract table gets 'the bar' and 'the mic's place' rows, and
the tap-travel row says what the chip does now; SessionContractNumbersTests
pins the four numbers and KeyboardParityTests checks the band and the
keyboard height against the measured glass file. The literal lint also
reads KeyboardKit's configuration labels.

design-diff.swift loses the crop command: its magenta border came from the
gallery's bare mode, which is gone. Stale comments that named the gallery,
the theme picker, the palette and the grille are corrected.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…renamed example

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@nbisht-aai nbisht-aai closed this Nov 10, 2026
nbisht-aai and others added 4 commits November 10, 2026 15:43
… context

In a field that capitalizes sentences the keys came up uppercase and stayed
there, and typed capitals (HI OK on the phone and the simulator): the
layout was built once from the context's case and handed to KeyboardView,
so the case change after the first letter never reached the keys.
BlurtKeyboardView now observes the context and rebuilds the layout on
every change; the letters drop after the first one, lift again after a
period, and shift lifts one.

The probe field takes -BlurtProbeSentences (sentence capitalization, as
Messages has it) for the new case flow, which runs with the other flows on
both faces: 84 checks green. DESIGN.md › Keys says the rule.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…ops, the lift does nothing; the space bar's hold is 0.25 s

The stop went out on the lift (and only after a hold, or on the second
tap's lift): the dictation ended one tap-length late and push-to-talk
decided every lift. Now the first finger down sends the press and the next
finger down sends the stop the moment it lands; a second press before the
answer stops the moment the dictation has its id; the lift sends nothing
but the hop after a refused press. PressHandshake loses the hold threshold
and foreign's liftStops; the model loses armedFromIdle and the held time.

The space bar's long press — the hold that moves the cursor — is
motion/space-hold 0.25 s on the space key alone, instead of KeyboardKit's
half second.

Tests say the new table (364, BlurtiOSCore 96.1 %); DESIGN.md › The mic key
and › Keys say the rule.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…he stop the instant the finger is off the key

Tap to start and tap to stop stay (the stop on the second finger down);
a finger down for PressHandshake.defaultHoldThreshold 350 ms or more is a
hold, and its lift is the release, sent at once — or, lifted before the
press is answered, the moment the dictation has its id. The lift of a tap
sends nothing. The contract table gains the 'mic hold' row; the flows hold
the mic for 1.5 s and see the key settle; 366 tests, BlurtiOSCore 96.2 %.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…key, the + and the bar change the instant the phase does

Every fade (state-fade, term-swap), the symbol replace transition and the
press animation (key-press) on the mic key, the glyph keys, the chip and
the bar are gone, and so are their tokens; the caret's blink and the
chip's hold time stay. DESIGN.md › The mic key and › The bar say it.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@nbisht-aai nbisht-aai reopened this Nov 11, 2026
@nbisht-aai nbisht-aai changed the title iOS: the keyboard is Apple's — rebuilt on KeyboardKit's free core, with the mic in the bottom row and the key-term bar above the keys iOS: keyboard redesign — Apple's keyboard on KeyboardKit, tap or hold to dictate Nov 11, 2026
@nbisht-aai
nbisht-aai marked this pull request as ready for review November 11, 2026 19:12
@nbisht-aai nbisht-aai closed this Nov 11, 2026
@nbisht-aai nbisht-aai reopened this Nov 11, 2026
The reopen of #315 ran the check on the head the PR had when it was closed
(c3e514e); this empty commit makes the push event that runs it on f9a101d.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@nbisht-aai nbisht-aai closed this Nov 13, 2026
@nbisht-aai nbisht-aai reopened this Nov 13, 2026
nbisht-aai and others added 4 commits November 13, 2026 13:55
Keeps the KeyboardKit keyboard over main's hand-drawn one and takes #297's
'Delete whole dictation' setting: undoLastInsertion is an ordinary delete
when the switch is off. Main's three-layout enum (KeyboardLayout.swift) is
dropped: the layouts are gone and the name is KeyboardKit's.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Just past a tap's length, so a tap still types a space; 0.25 s read as a wait.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
With 'Delete whole dictation' off, undoLastInsertion declines and KeyboardKit
deletes one character as for any key; on, it takes the dictation back.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The one-tap undo (delete right after a dictation taking all of it back),
its 'Delete whole dictation' setting and toggle, the insertion record the
model kept for it, and their tests are gone: delete is KeyboardKit's, one
character like any key.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@alexkroman
alexkroman merged commit d25c5ec into main Nov 18, 2026
19 of 21 checks passed
@alexkroman
alexkroman deleted the feat/ios-keyboardkit branch November 18, 2026 23:50
@alexkroman alexkroman mentioned this pull request Nov 19, 2026
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Nov 28, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants