Skip to content

Integrate Phase 2 batch 11: #160, #185, #154, #183 - #187

Merged
HMarzban merged 196 commits into
mainfrom
integrate/phase-2-batch-11
Nov 22, 2026
Merged

HMarzban merged 196 commits into
mainfrom
integrate/phase-2-batch-11

Conversation

@HMarzban

Copy link
Copy Markdown
Contributor

Merges four reviewed PRs onto main 2764fb5 (batch 10) in one CI run. They merged cleanly; typecheck and 4,319 unit tests pass on the branch.

Also on this branch: AGENTS.md's editor-chunk rule now matches the owner's 2026-11-22 decision. Byte budgets are a tripwire, not an approval gate.

Deploy: each PR's own CHANGELOG notes apply (Bun 1.4.5 is already on the host).

INSERT_KIND_CHOICE keeps the last 3 kinds (contract A19). The "/" menu
leads with a Suggested section of the recent kinds that can run at the
caret, each also in its own section; a query drops it and breaks rank
ties toward recent kinds.
An empty query shows a "Type to search" ghost after the "/" when
nothing follows the caret, and never during IME composition. A pinned
footer teaches the active row's Markdown shortcut and has a Close
button; the list is 320 px wide and anchors to the "/" on the
content's start side. "New" badges are declared in the lazy chunk and
ship empty.
The bar's Insert cell opens a bottom sheet instead of the desktop
dropdown (spec §8.3, O6 a): the "/" menu's items as a two-column grid
of 44px cells, Suggested (the remembered kinds) on top, then Blocks or
Turn into (by whether the caret's block is empty), then Insert. Table
and embed open their step inside the sheet from the lazy insert step
chunk; Diagram lists the templates. A pick closes the sheet and focuses
the editor inside the tap, so the caret lands in the new block. The
sheet answers insert.open, so "/embed" on a phone opens it at the
embed step. Both sheets pad 16px plus the safe area at the bottom,
drawn as a 16px scroll fade.
On a fine pointer a + sits in the start margin of an empty top-level
paragraph: beside the caret 300 ms after the last keystroke, or under
the pointer after a 150 ms dwell, never during IME composition. A click
types the "/" outside the undo history, so the ordinary "/" menu opens;
Esc on its empty query removes that "/" again, and a pick stays one
undo step. It lives in the slash chunk; the host renders it once the
chunk has loaded.
The editor chunk must not grow, so SlashMenuHost renders nothing new:
the lazy bubble chunk's desktop wrapper mounts EmptyLinePlus next to
the status pill, and the + gates itself on a fine pointer. The New
badge uses the muted tokens (the contrast test forbids --primary text).
Insert menu rows show the "/" alias that finds them ("/table"), and an
empty paragraph's placeholder reads "Type / for blocks". A contract
test checks that the "/" menu, the + and the Insert and phone list
cells name only registry ids and hard-code none of their labels, and
that every Markdown hint in "/" makes its block through the real input
rules. It caught the footer tip asking for no space after "-".
The Aa sheet leads with Style (spec §13.1, F16): Text and H1-H3, a More
headings disclosure for H4-H6 (open when the current style is one of
them), then the lists and Quote, the current one pressed. Colours
follow, unchanged.

On a touch tablet the row's unclear stand-ins get one fixed word each:
Format, Layout and Block (O8 a). CSS only, from the lazy menu chunk, so
the editor chunk group is unchanged; shown from an 832px row, where
the row fits them in every context.
The embed step's link field raises the keyboard: the sheet now rides on
it, like the bar, no taller than what it leaves, with the field kept in
view. A pick refused since the sheet opened keeps the sheet open, says
why on its own status line and redraws the cells with the reason. The
insert.open frame is cancelled on unmount, so it never leaves the page
inert. Suggested copies carry data-suggested.
The record of which "/" the + typed lives in the slash chunk only (the
+ reaches it with a dynamic import, so the bubble chunk has no copy of
it), follows the trigger's own position and is dropped the moment the
trigger closes, even before the menu mounts: a "/" typed later is never
taken for it. The + re-derives its line from the DOM, so a
collaborator's edit never leaves it on a stale position, wakes on a
transaction only when something can change, and listens passively.
insertKindOf returns an InsertKind; MAX_SUGGESTED and
recentInsertKinds are exported for the phone Insert sheet.
lib/links/doc-link.ts parses the three tinydocy: forms strictly and
claims every tinydocy: href for routing, so none reaches an external
opener. LibraryIndex entries carry their linkKey and the snapshot lists
trashed documents, so a link can say In Trash.
# Conflicts:
#	docs/superpowers/specs/2026-11-13-smart-toolbar-v1-contract.md
DocumentEditor takes an optional linkHost (protocols, isAllowedUri,
navigate, linkIcon) and spreads it into the Hyperlink configuration,
the D23 linkHost ledger line. The editor imports only its type, and the
web sandbox passes none, so its links behave as before. The import
boundary walker now reads .ts files as TypeScript and skips non-script
imports.
extractLinks walks a document's Yjs fragment and returns one row per
document link (section heading id, link key, heading id, text and up
to 160 characters of context), reading only hyperlink marks and the
blocks that hold them; linksHash lets a caller skip an unchanged pass.
consentLinksLine is the sentence P4.4's consent window shows when a
document links to your other documents.
createLinkHost assembles the Hyperlink options a host passes the
editor: the tinydocy protocol, isAllowedUri that writes only parseable
document links, linkIcon drawing each section 4.6 state from the index
snapshot (FileText, Trash2, FileX, FileQuestion), and navigate. Our
scheme never reaches the external opener: links open the document (Mod
stays in this tab, Mod+Shift or middle opens a new one), here# links
jump to their heading, and unresolved states are announced. The
extension never redraws icons, so the host exposes refreshIcons for
index changes, and openAtHeading for jumps after a document opens.
On the app's real editor with a link host, a tinydocy: href this
version can't parse survives loading and edits around it, draws as an
unknown link, and can't be written anew.
A links view in the library harness puts the link host on a small
editor beside the sidebar, with every link state seeded. The spec
checks each state's icon and dashed underline, Mod-click following in
this tab and to a heading, Mod+Shift and middle-click opening a new
tab, here# jumps, the removed-heading notice, icons redrawn when the
target is trashed, and that only web links reach the external opener.
lib/links/doc-links.css draws the dashed underline for links that
don't open.
One page of before and after pairs for P1 to P4 against main 7b9fdc7, at
320, 390, 768, 820 and 1280 px in light, dark and RTL, with the owner's
open decisions and a recommendation for each at the top.
# Conflicts:
#	CHANGELOG.md
#	package.json
…inks

# Conflicts:
#	CHANGELOG.md
#	docs/superpowers/specs/2026-11-16-search-linking-design.md
…ary index

RpcLibraryIndex mints the 32-hex link_key with the id on create and sends
it; the engine's createDoc keeps a caller's key and refuses a malformed
one. The sidebar returns each document's linkKey, and trashList adds the
trashed list, every document in the Trash (alone or in a folder) with its
key. LK1's LibraryIndex contract cases now pass on the desktop index.
The owner approved all seven review-page decisions as recommended on
2026-11-22. Spec §13.5 records them (decision 2 amends O4), §17 gains the
submenu chevron, the bubble's comment icon (P5) and the Aa sheet's Text
icon as follow-ups, and the review page's decisions box says so.
Every connection sets busy_timeout (3 s): on Windows a scanner or a
process still letting go of a fresh library held it for a moment, and
the next write failed with "database is locked" (soak T4-copy). TRUNCATE
checkpoints run with no timeout, so a reader such as the daily copy
never stretches a quit. Contention tests hold the lock from a second
process.
Derived rows are a cache: a power cut loses them and their derived_seq
together, and the document is derived again. Committing them at
synchronous=NORMAL keeps a read queued behind a derive (backlinks, soak
T21) from waiting for F_FULLFSYNC or FlushFileBuffers. Everything else
stays FULL; the architecture spec's D-A6 records the amendment.
One run's median moved with the runner (7.4 then 10.0 ms on Windows for
the same code). The case now reports each run's median, p95 over every
round and the derive's SQL time beside its round trip.
The Trash list's link keys include documents in a trashed subfolder (and
leave templates out), and an optimistic create whose key collides rolls
back. The data-model revision's mintDoc row now says id and link_key may
come from the caller, validated, and lineage always comes from the worker.
The LibraryIndex contract also runs in the Electron storage harness, whose
expect shim has no toMatch; the 32-hex check now uses a regex test and toBe.
The Text style alignment test treated every digit-ending shortcut as one
width. On Linux the lists' Ctrl+Shift+8 is wider than Ctrl+Alt+0, and
rounding each edge apart turned a sub-pixel offset into 1 px, so CI
failed while the menu was aligned. Compare the four style shortcuts'
widths and every shortcut's inline end, unrounded, within half a pixel.
The bubble's face and Turn into imported lucide's Type from lib/icons, a
module the editor chunk group also holds. After main's batch 10 (Find,
Markdown paste) those two lazy import edges made Turbopack split the
group's small modules across two files instead of one (+932 B gz, same
raw bytes). A copy of the icon built with createLucideIcon renders the
same SVG and keeps the group as on main; "/" still uses lucide's.
… editor chunk's exports

Turn into imported TITLE_STYLE_REASON from core/blocks and "/" imported
isInsertKind from remembered-choice, so the editor chunk exported both
for lazy chunks (-23 B gz without them). Turn into keeps its own copy of
the string, as it already does for "Not available in the title.", and
"/" reads the same validator off INSERT_KIND_CHOICE.
The owner approved 26 B of editor-chunk growth for P1 to P4 on
2026-11-22: the style-lift hook, List and Quote in the style value and
the phone Insert sheet's nested lazy load, measured 394,519 to 394,545 B
gz on main 2764fb5. EDITOR_CHUNK_LEDGER_BYTES goes from 2,205 to 2,231 B,
the details spec's D23 table and fence follow, and the CHANGELOG and
contract A21 record the sizes and the Type icon copy.
The owner decided on 2026-11-22 that editor-chunk byte budgets must not block
features or need their approval: PRs record measured growth as a ledger line
and raise the fence in the same PR.
@HMarzban
HMarzban enabled auto-merge November 22, 2026 15:10
…bular figures

CI's Linux font has no tabular figures, so Ctrl+Alt+2 is a pixel narrower
than Ctrl+Alt+0 while every shortcut still ends at one inline end. Keep
the shared-end check exact and allow up to 1.5 px between the widths.
@HMarzban
HMarzban added this pull request to the merge queue Nov 22, 2026
Merged via the queue into main with commit f667af7 Nov 22, 2026
29 checks passed
@HMarzban
HMarzban deleted the integrate/phase-2-batch-11 branch November 22, 2026 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant