Skip to content

Page layout, navigation tree, a schema-editor lesson and a light theme - #12

Merged
Kinflou merged 2 commits into
mainfrom
ui/page-layout
Nov 14, 2026
Merged

Kinflou merged 2 commits into
mainfrom
ui/page-layout

Conversation

@Kinflou

@Kinflou Kinflou commented Nov 14, 2026

Copy link
Copy Markdown
Member

Depends on ComlineProject/playground#121. Until that merges, comline-web-kit is pinned to its branch (2e058f1). Repin to the merge commit on master before merging this.

Layout

  • The page is exactly the window's height and never scrolls itself.
  • The navigation runs down the left side. The content scrolls beside it, and the Back/Next bar stays at the bottom.
  • On narrow screens the navigation goes above the content.
  • Disabled Back/Next buttons are greyed out and aren't links. Before, they linked to the page you were on.

Navigation tree

  • Parts and their numbered sections come from PARTS in src/lib/paging.ts. PAGES is now derived from it, so pageUrl works as before.
  • The part you're reading starts open, the others fold, and the current page is highlighted. Back/Next carry on across parts.

Chapters
Placeholder pages ("coming soon") so the tree has something to show:

    1. Basics: Your first schema, Structs and enums, Protocols
    1. Generating code: Running the generator, Using the generated code

"Your first schema" (2.1)

  • The lesson text is on the left.
  • On the right is the playground's editor (comline-web-kit/editor), with the language server's highlighting, errors, hover and completion.
  • Compile generates Rust or TypeScript and shows the files beside the schema. If the schema has errors, it lists them instead.
  • Any page can put something beside its lesson with slot="workspace".
  • A new Code component colours inline schema snippets in the text the way the editor does.

Light theme

  • Dark stays the default. A header toggle switches to a warm light theme: beige rather than white, with darker syntax colours. The browser remembers the choice.
  • Every colour is now a variable in global.css, and the editor and the simulation follow the theme too.

Build

  • CI now builds the kit's editor WASM, so COMLINE_KIT_EDITOR=0 is gone.
  • The yarn cache key has a new prefix, so CI can't restore an old copy of the kit packed without the editor.
  • The editor adds 2.2 MB of WASM (820 kB gzipped), loaded only on pages that use it.
  • worker.format is es, for the compiler's module worker.
  • New dependencies: @codemirror/lang-rust and @codemirror/lang-javascript for the generated code, plus @codemirror/state, view and language, which the component imports directly.

Testing

  • yarn check: no errors and no warnings.
  • yarn build succeeds.
  • Playwright: 6 of 6 pass. Three tests are new:
    • navigation: the current page is marked, parts fold, and Next crosses into the next part;
    • first-schema: compiles to Rust and TypeScript, then reports a typo;
    • theme: the site starts dark, switches to light, and keeps it after a reload.
  • Checked at 1600, 1280, 800 and 390 px wide.

- Layout: the page fills the window and never scrolls. The navigation runs
  down the left side, the content scrolls beside it, and the Back/Next bar
  stays at the bottom. On a narrow screen the navigation goes on top.
- Navigation: a tree of parts and their sections, built from PARTS in
  paging.ts. The part being read starts open, and the current page is
  marked.
- Chapters: placeholder pages for Part 2 (Basics) and Part 3 (Generating
  code).
- "Your first schema" (2.1): the lesson on the left, and on the right the
  playground's editor (comline-web-kit/editor) with a Compile button.
  Compiling shows the generated Rust or TypeScript beside the schema, or
  lists the errors. Any page can put a workspace beside its lesson with
  slot="workspace". A Code component colours inline schema snippets the
  way the editor does.
- Theme: dark stays the default. A header toggle switches to a warm light
  theme and remembers the choice. All colours are variables in global.css.
- Build: the kit's editor WASM is now built (COMLINE_KIT_EDITOR=0 is gone
  from CI), and the yarn cache key changed so an old kit packed without the
  editor isn't restored.
@Kinflou
Kinflou merged commit 1df1fc7 into main Nov 14, 2026
7 checks passed
@Kinflou
Kinflou deleted the ui/page-layout branch November 14, 2026 16:52
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