Skip to content

web-regions: inner scroll regions, dialog focus, comment width, v0.4.0 - #11

Merged
JaimeStill merged 9 commits into
mainfrom
web-regions
Dec 1, 2026
Merged

JaimeStill merged 9 commits into
mainfrom
web-regions

Conversation

@JaimeStill

Copy link
Copy Markdown
Contributor

capstone.data-intelligence.mikoshi · task 22/38 · web-regions

Summary

  • web-foundation v0.5.0
    • page-app is exactly the viewport's height, and main is its one scroll region.
    • .fixed-rows keeps a view's rows in place while its .scroll-frames scroll.
    • .dialog-body and .dialog-actions give a dialog a fixed header, a scrolling body, and a
      fixed action row.
  • web-components v0.4.0
    • sl-pagination, sl-document-list, and sl-search-results scroll inside a held host.
    • sl-drawer gains initial-focus.
    • A test checks where every example dialog opens its focus.
    • A comment-width step joins the check.
  • webappgen v0.4.0: the service-app dev loop is air alone, building the client before each
    go build.
  • The narrow case across the stack is 390px at text 100%. Nothing tests 200% text or 320px.
  • Slices 10 and 12 are checkpoints that run during SHIP. After web-foundation v0.5.0 is tagged,
    web-components pins it and its example dialogs adopt the column. After web-components v0.4.0 is
    tagged, webappgen's starter takes both releases and adopts the column and .fixed-rows.

Core changes

  1. The page and its rows: Mikoshi stops holding the page to the viewport in its own CSS.
    <body class="page-app"><header>…</header>
      <main><div class="fixed-rows"><nav>…</nav><ol class="scroll-frame">…</ol><p>…</p></div></main>
    .fixed-rows fills main when it is main's only child. Several frames share the remaining
    height equally, so content arriving in one frame doesn't move another.
  2. The dialog column: a long dialog keeps its title and its Save button in view.
    <dialog><header class="dialog-header">…</header>
      <form method="dialog"><div class="dialog-body">…</div><footer class="dialog-actions">…</footer></form>
    A body that holds .scroll-frames doesn't scroll itself; each frame scrolls on its own.
  3. Inner scroll regions: in a held host, a list scrolls while its summary, status line, and
    page controls stay in view. Unheld, each element is as tall as its content.
  4. sl-drawer initial-focus="<id>": a modal drawer opens on the named child, such as a
    filter or the tree's current row. Otherwise it opens on its heading. A docked drawer never
    takes focus.
  5. scripts/check/comments.sh: a comment line over 100 columns fails as
    path:line: comment is N columns; rewrap it to 100. It covers TS, JS, CSS, shell, and TOML.

Verify

mise run check:

  • web-foundation ✓ 294 browser tests, lint, types
  • web-components ✓ 101 unit and 512 browser tests, lint, the comments step
  • webappgen ✓ go, lint, shellcheck, actionlint, the integration tier
  • capstone-mikoshi ✓ lint-context and lint-references (only the goal record changed)
  1. Run mise run examples in web-foundation and open app.html at 390px and 1280px. Scroll the
    entry list. The document never scrolls, the list scrolls inside its frame, and "40 entries"
    stays at the foot.
  2. Open prose.html with tall content. The document scrolls as before.
  3. Open dialogs.html, then "Edit the record". Focus is on Title, the fields scroll between the
    fixed header and the Cancel/Save row, and the dialog itself never scrolls. Open "Changes". Its
    two lists scroll separately.
  4. Run mise run examples in web-components and open document-list.html. In devtools, give
    the list style.blockSize = "160px". The entries scroll, and the summary and page controls
    stay put. Remove the size, and the list is as tall as its content.
  5. Open drawer.html at 390px. Documents opens on its filter, and Outline opens on its heading.
  6. Add a 103-column comment to src/drawer.ts and run mise run check. It fails, naming
    src/drawer.ts:<line>.
  7. In a project written by webappgen new service-app, run mise run dev. Only air runs, and an
    edit to client/src/views/home.ts rebuilds the client and restarts the service.

Screenshots for every profile, light and dark, at 390px and wide, are in
/tmp/claude-1000/-home-jaime-capstones-capstone-mikoshi/0b032d02-2918-43c9-9f2a-6d9d2e09fac9/scratchpad/screenshots/.
The app page is 11-app-390px--* and 12-app-wide--*, the dialogs are under light/ and
dark/, and the components are 3-pagination--*, 10-search-results--*,
11-document-list--*, plus a compact/ folder.

Decided without you

  1. main reserves its scrollbar gutter (scrollbar-gutter: stable), so a scrollbar appearing
    never narrows the content. The content lines end one scrollbar width before main's edge.
  2. .fixed-rows fills main only as its only child, so a lede goes inside the rows and isn't
    stretched.
  3. Frames share the remaining height equally (flex-basis: 0), in a .fixed-rows and in a
    dialog body. A dialog whose body holds frames fills the modal's maximum height.
  4. A short dialog body isn't stretched, and the actions sit directly under it.
    .dialog-actions is a wrapping row at the inline end.
  5. sl-pagination gains a before slot, so the document list's status line stays out of the
    scrolling page.
  6. The lists are inset by --focus-reach, so a focused row's ring isn't clipped. Everything
    sits about 4px further in.
  7. web-foundation's crowded-header case adds 8 buttons, so the header's wrapping is still tested
    at 390px/100%.
  8. Three specimens got longer content so the narrow cases still have something to wrap.
  9. sl-drawer's initial-focus is an id, and the drawer focuses it right after showModal().
    The alternative, autofocus, loses to the drawer's shadow heading in flat-tree order.
  10. The comment step treats extensionless files with an sh shebang as shell. A trailing
    //, #, or /* counts only after whitespace, so URLs, globs, and $# pass.
  11. The dev loop keeps scripts/dev.sh as exec air, and dev no longer depends on
    client:build. Air watches .go, .ts, and .css, and excludes the client's dist/,
    node_modules/, test/, and scripts/.
  12. Spec gaps closed: the last 320px test case and the drawer's 480px captures and tests moved
    to 390px. A duplicate id in web-foundation's example dialog is fixed. Settings still focuses
    its radio from its own code, as the dialog-focus page allows for a shadow-root control.
  13. The editor dropped these Decisions:
    • "web-regions: a dialog becomes a column…", now in web-foundation's docs/use.md
    • "web-regions: scroll regions reuse .scroll-frame…", now in docs/use.md
    • "web-regions: the dev loop is air…", now in webappgen's README and docs
    • "scroll-regions: a dialog opens on its first editing or choosing control by autofocus…",
      to stay within the Decisions budget. Its rule lives in architecture's dialog-focus.md
      and in web-components' new test, so only "Rejected: Close last in DOM order" is lost.

Redirects and escalations

  1. Escalation, slice 8: should a drawer that holds a field or a tree open on it? Answer: yes.
    sl-drawer gains a property naming the slotted control to focus when the drawer opens as a
    modal.

Merge danger: one-way for the tags web-foundation v0.5.0, web-components v0.4.0, and
webappgen v0.4.0, which accepting authorizes. Everything else is two-way.

  • Blast radius: consumers that install these tags. Mikoshi takes them in scroll-regions.
  • Merges go one repository at a time: web-foundation, then slice 10, then web-components, then
    slice 12, then webappgen, then capstone-mikoshi (the record). Each merge waits on CI.

Needs you: none. After SHIP, the closeout retro you asked for:

  • writes the web-elemental scroll-regions page
  • updates dialog-focus.md for initial-focus
  • applies the roadmap wording (390px; no pagination or composer fixes)

- mise.toml: pnpm 12.23.0 -> 12.25.1.
- package.json: globals 17.14.0 -> 17.15.0; lockfile regenerated under
  pnpm 12.25.1, which passes its supply-chain policies.
- The web-foundation pin stays at v0.4.0; currency reports it current.
- CHANGELOG opens an Unreleased section for the bumps, as 6084f9f did
  after 0.2.0.
sl-pagination, sl-document-list, and sl-search-results are flex columns of
min-block-size: 0 whose list is the one scrolling region (flex: 1 1 auto;
min-block-size: 0; overflow: auto). Held by a size on the host or a sized
flex or grid parent, the list scrolls while the summary, the status line,
and the pagination's controls stay in view; unheld, each is as tall as its
content. The host doesn't grow to fill: a consumer's .scroll-frame or flex
sizing does that, and in a row parent a grow would widen it.

Decisions:
- The scroller clips a focused button's outline, so the region's padding
  and scroll padding are --focus-reach, and the summary, status, and
  controls' rows take the same inline padding, so their text starts at the
  list's button edge. The controls' rule still spans the host.
- sl-pagination gains a `before` slot, a row between the summary and the
  page, outside the scroll. sl-document-list puts its own-line status
  (no summary to join, or error) there, so it stays in view.
- The specimen pages' narrow section is 390px (the narrow case at text
  100%) in place of 20rem; tests and captions follow. Component width-range
  cases (20rem/40rem, the entry's 16rem floor, the drawer's dock) stay.
  Three specimens whose narrow assertions needed content to wrap at 320px
  got longer content: an entry with a long content type, a UUID run id in
  run.json, and a longer function name in the chat thread. Nothing
  overflowed its container at 390px.
- The probe's content-type case skips wbr, which has no box and sat at the
  viewport origin.

Tests: a held-host measure (test/browser/support/held.ts) per element, in
a held flex column and a held scrolling grid, plus the unheld column.
dialog-focus.test.ts reads the example pages, finds each page's dialog and
sl-drawer elements, opens each by its opener at 390px, and checks focus lands
on the first control that edits or chooses, found through the flat tree, or
else on a tabindex="-1" heading, never on Close. A last case pins that the
pages hold both kinds, so an empty read can't pass.

The Documents drawer failed: it holds a filter field but opened on its heading.
sl-drawer gains initial-focus (initialFocus), the id of a child control the
modal drawer focuses right after showModal(), falling back to the heading when
no child has that id, and focusing nothing docked. Marking the slotted filter
autofocus could not work: the dialog's autofocus search runs in flat-tree order
and meets the shadow heading first, and autofocus in the page's markup takes
focus on load while docked. The specimen's Documents drawer names its filter.

themes.test.ts's drawer focus ring case now opens the modal Outline drawer,
whose heading Tab leaves for the shadow Close, since Documents now opens on its
light-DOM filter. STANDARDS.md's dialog-focus line says sl-drawer opens on its
heading unless it names a slotted control to open on.
scripts/check/comments.sh fails on any comment line longer than 100 columns in the TS, JS, CSS,
shell, and TOML files git ls-files lists, naming the file and line and the fix; #MISE lines are
skipped. mise-tasks/check runs it after the format step, and .agent/mise-tasks/check/comments
wraps it.

- Bash and awk only, so Mikoshi can copy it. awk runs under LC_ALL=C and counts characters as
  bytes less UTF-8 continuation bytes, the same on gawk and mawk.
- A comment is a full-line // or #, a trailing // or # after whitespace, or a line within a
  /* */ block opened at a line's start or after whitespace, so URLs, globs like test/unit/*.ts,
  and $# or ${#a} in shell aren't read as comments.
- Shell files without an extension count when their shebang names sh or bash, so the file tasks
  are covered.
- test/unit/comments.test.ts runs the script in a scratch git repository against generated
  fixtures; the fixtures can't be tracked files, since the step would fail on them.
- The five over-long comment lines found (examples/specimen.js, src/artifact-viewer.ts,
  test/unit/release.ts) are rewrapped with their words unchanged.
…re its child sits

The drawer's attribute-to-property test restated Lit's mapping; it now sets the property and
checks the drawer opens on that child. The pagination's before-slot test read the slot's name and
its wrapper's class; it now checks the slotted child sits between the summary and the page and
stays put as the entries scroll.
The drawer's captures below the dock ran at 480x800; they now share the settings' narrow
viewport, 390x844, still below the 48rem dock. The drawer's browser tests named 480px as
NARROW; it is now 390px, and the edge-to-edge case takes NARROW with the suite's height.
docs/components.md names the frameless-open capture at 390px.
The development pin moves to web-foundation's v0.5.0 tag (lockfile at
1fc1417, the tag's commit; the supply-chain policy passes) and the peer to
^0.5.0, a breaking change for a consumer on 0.4, recorded as such in the
CHANGELOG.

The example pages' Help and Settings dialogs (components, settings,
shortcuts) hold sl-shortcuts and sl-settings in the foundation's
.dialog-body; neither has an action row, so no .dialog-actions. The
README's Settings and Help markup takes the same body, so a consumer
copying it gets the column. The test fixtures' bare dialogs stay as they
are: they test the elements, not the foundation's dialog layout.

No example page or fixture uses body.page-app, so v0.5.0's held page and
main scroll region change nothing here; the drawer's shadow dialog has no
.dialog-body and keeps its own column. Nothing else needed changing:
mise run currency exits 0 and the check passes, the dialog-focus test
included.
package.json is 0.4.0. The CHANGELOG's Unreleased becomes [0.4.0] -
2026-12-01, with its [0.4.0] link line; README's install lines name
web-components v0.4.0 and web-foundation v0.5.0. Not packed or tagged.

Decisions:
- No empty Unreleased stays above 0.4.0, as the 0.3.0 prep (0ac015a,
  cc605ef) left none.
- A short paragraph above "### Added" says what breaks, as
  web-foundation's 0.4.0 and 0.5.0 do: the peer at ^0.5.0, the frameless
  lists scrolling inside a held host, and sl-pagination's --focus-reach
  inset.
- README's dependency sentence names marked 18.4.0, the pin since 0.3.0,
  where it still said 18.2.1.
@JaimeStill
JaimeStill merged commit a9136e5 into main Dec 1, 2026
1 check passed
@JaimeStill
JaimeStill deleted the web-regions branch December 1, 2026 18:02
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