part 35
One window, one card per realm: the page register, the footer, statistics, settings and what the browser showed
A realm states in its manifest which pages it has, and the platform builds one window with a card for each realm. Edges from the core into the packages fell from 107 to 94, the moved tabs gave the same output, and two bugs showed up only in the browser.
On 1 November 2026 the windows of the home screen of Audamir (scoreboard, rules and score, guide, statistics and settings) stopped being windows of Kastgard. Each one is now one window per page, with a card for each realm, and the data in a realm's manifest say which pages it has. Edges from the core into the packages fell from 107 to 94, and nine statistics tabs of Kastgard gave the same output in 25 of 26 comparisons. Each setting entry sits in exactly one place. Two bugs that no check had seen showed up only in the browser.
The realm states the data, the platform builds the window
The scoreboard and the rules were in panels.js, the nine statistics tabs in profileview.js (the first file named five things from Kastgard's code, the second eleven). The decision of 1 November set that the scoreboard, the rules, the guide and the statistics are always one window with a card for each realm that registers the page. The model has three parts:
- Data. The manifest has a field
pageswith six possible pages:scores,rules,howto,stats,heroandsettings. Onlysettingsmay have akeysfield. An unknownid, a duplicate, more than six pages, or anything that is not plain data is an error in the manifest, and the realm is rejected. - Code. The manifest has no functions, so a realm has a hook in the API,
page(id, host, ctx), which fills the element the platform gives it. The core knows no realm's name. - Window (
js/ui/page-window.js, 133 lines) knows neither the realm nor its manager. The window has no names of its own: a test reads its source and looks for them. A card is built only at the first choice, and the footer of the window is the footer of the card shown.
A realm without a page has no card and is never a "coming soon" tab. Which card opens: from the hub of a realm, its own card (if it has the page, otherwise the first one); from the home screen, the card All realms if the window has it, otherwise the card of the realm of the last game played. A test adds three toy realms with only a manifest and a file pages.js; the new card appears without any change to the application. One reservation: the cards of the home screen are taken from the table of modes, so a new realm still needs a row there for now (debt of step M9, DESIGN §116.3).
The first step (H5a) was not visible: the windows still had no content, and a test pinned that (DESIGN §116.4).
The state of the set with two realms (manifests js/realms/*/data/realm.js, the evening of 1 November 2026) is in the picture:
Footer: the link is where the page is
Step H5b gave the windows content. The footer of the home screen shows a link only to a page that some realm registers. Backup, "What is new" and reporting a bug are always in the footer. A set with only Rokgard has one of the three window links: How to play. The code moved to js/realms/kastgard/ui/pages.js:
Panels.openScores→scores(host)in Kastgard; the scoreboard leftpanels.js.Panels.openRulesand five pictures →rules(host, ctx).LessonRunner.openList→LessonRunner.fillList(host, realm), that is, How to play for each realm.
The short guide of Rokgard has no new text: it is five lines of Colony's rules and four lines of Lines' rules, which already show the setting screens of the games. A test pins the keys and their order. The player sees this: How to play has two cards for the two realms, the hub of Rokgard has a How to play button, and the scoreboard is named just Scoreboard.
Edges from the core fell from 107 to 105: panels.js from 5 to 3, because Rules, Stats and Bonuses belong to the live statistics of a game and stayed. Twenty text keys were renamed in nine languages without changing one character, and three window names that no longer wrote anything disappeared.
The step found things that the documents did not know. The hook must already be in the API at require in Node, because the manager rejects a realm with pages and no hook. The key S is not a door to a page, because it opens the live statistics of a game. The button "Clear scoreboard" stays in the footer even after clearing, because the window reads the footer once, when it is opened.
Statistics: three cards and nine tabs
Step H6 gave the statistics cards:
- All realms (the platform,
ProfileView.allRealms; the first one, when two realms are revealed): games played and won, reputation in Asgard, the coin of each realm and the table "By realm". The numbers come from the registry, not from the code of the realms. - Kastgard: nine tabs without change, moved word for word from
profileview.js. - Rokgard: a general card for the board games: a strip of games, wins, losses, draws, experience and tokens, by AI level, and the last games.
The core of the step was the move. The tabs tabAll, tabConfig, tabClassic, tabMinis, tabPuzzles, tabCampaign, tabIron, tabGames and tabRivals left profileview.js for Kastgard's pages.js, word for word. The numbers on the card All realms come from the registry: a realm's specification in Economy received an optional won(profile), and Economy.recordOf(realm, profile) returns { played, won }.
Edges from the core fell from 105 to 94: profileview.js from 11 edges to zero, the file from 533 lines to 272.
The proposal estimated up to 16 edges (5 from panels.js and 11 from profileview.js); 13 disappeared (2 + 11). The 94 of today are 58 from the core to Stacks, 24 to Campaign, 4 from Stacks to Campaign, 2 from the core to Kastgard and 6 to the others.
The proof that the output did not change: one profile made by the real recording functions is rendered by the old code and by the new one, and the DOM of each tab is compared as text. The profile contains 24 games of all modes, mini-games, puzzles, the Campaign, the Iron run, rivals and a record; the old tree is from version 0.73.0. 25 of the 26 results are the same. The only difference is the footer of the window, which now has a platform slot with the same button. The same are the nine tabs, the dimensions of the configurator, the three levels of the Iron run, the strip of cards, Slovak, and the tab opened by the doors. In addition, 17 mutations of a copy of the tree, all 17 caught, and 108 states in the browser (nine languages, two sizes, dark and light theme, three cards) without any horizontal scroll.
The statistics tile is in the hub of each realm, is revealed once, and the NEW badge disappears after opening it anywhere. DESIGN §121.4 says that such a tile does not exist and that adding it is a decision; after looking at the finished statistics, it was decided that it will be there. The tile has one id in three places (home screen, hub of Kastgard, hub of Rokgard); in a set with one realm the hub also serves as the home, so the second tile is left out. Notes from 1 November asked that the tile exist in the hub, and that the mouse wheel in the statistics move the window and not only the scrollbar. Colony's presets record counts only by AI level; Lines have five presets or a custom board. What a game records:
| Game | What is recorded | What a breakdown can be made from |
|---|---|---|
| Colony | counts by AI level only | the board hex58 and hex61 |
| Lines | counts by AI level only | five presets or a custom board |
History is cut to 1,500 lines for all modes together, so it is not a lasting total. That led to a decision without migration: the record byPreset is kept from now on next to the counts by AI level, and a profile that does not have it yet is filled in from history only when it is read. What history does not have (games before its start, damaged code, a removed preset) is the line "Older or other games", so the lines and the rest always add up to the card's total.
Proof (DESIGN §125.5): a fixture made by the old code loads without adding anything; seven new tests were added, eight mutations were caught, and in the browser one real game of Lines played by clicks recorded byPreset correctly.
Settings: each entry in one place
The gear window is the window of the page settings: the card All realms, a card for each realm that names its own keys, and no card for a realm that names nothing. The rule is the function Settings.lookCards(claims): it splits the look entries into hero entries, realm entries and the rest, which belongs to the card All realms. In total there are 24 entries (at step H4 there were 23). The core names nothing for All realms and knows no realm's name. A test pins that each entry is in exactly one place, and a new entry without an assignment fails it.
Entry counts of the group look by place:
| Place | at step H4 | today |
|---|---|---|
| Your hero | 5 | 7 |
| All realms | 9 | 9 |
| Kastgard | 9 | 8 |
| total | 23 | 24 |
The difference: the entry "Avatar in the corner" became a hero setting, and the entry "Avatar motion" was added. The row "Your hero" stands above the cards. The window opens on the card of the realm from the screen it was opened from, and from the home screen on the card All realms.
Rokgard has no card in the gear window, because it names no setting of its own. It reads only the hero's entries and the speed that all realms share. A card appears with the first key; the candidates for a setting (circles of reachable cells in Colony, the ghost of a stone in Lines) have not been measured or proposed yet. When the editor of free play was examined, it was measured that not one of the 23 entries is a setting of a single game: all of them are read from the player's live settings object and saved with the profile. So the five hero entries left the editor; the tab now starts with the row "Your hero" and the other 18 stayed. It is a separate commit that can be reverted with one revert.
Two things remain open. In a set without Kastgard, the nine entries about the die have no one to name them, and they stay on the card All realms. And the cut labels at 375 px are not new; they belong to the freeze check (H7).
The browser found two things
The wheel. Every Kastgard tab had overscroll-behavior: contain from the time when it was the scrollbar of its own window. The checklist has an arrow, Esc, buttons and 108 layout states; the wheel is not there, because those states look for overflow, not for scrolling. A measurement with a real wheel: after five turns the window stayed at zero; with overscroll-behavior: auto it reached the end, 96 px. In a page window the window itself scrolls, so the wheel was caught by the tab and did not reach the window. The fix is a rule in style.css; a test pins it by reading the CSS, not by turning a wheel.
How to play in the footer. The link in the footer opened the card of Rokgard regardless of the screen, so in the hub of Kastgard it was the wrong card. The fix: from the hub, the card of its realm opens. The window also changed its height when a card was switched, because the list of lessons of Kastgard is long and the guide of Rokgard is short, so the strip of cards went out from under the cursor. The fix is one line: the minimum height that the statistics already had before.
Bugs were found while working, too. In a check of the doors it was found that "Back to lessons" opened the card of the last game, not the card of the lesson's realm.
The whole suite found more things in each step. At H4 three pins (two tests of Kastgard's pages and a test of the dots on the die); at the presets a test of the facade that did not pin the list of members. The most instructive is H6b: pinned lists of tiles failed, as expected, and four tools that compare the arrangement of tiles also reported a difference from the old code (home-layout-migration, home-panels-migration, rokgard-migration, sections-migration). Equality with the old code is proof only as long as it is said what may differ; each of them got an exception for the statistics tile.
The targeted run (tools/test.js --changed) runs only the tests of the touched packages; the whole check takes about a quarter of an hour.
What remains
- Rokgard has no Rules and score card and no scoreboard. Its manifest registers
howto,statsandhero. - Tables on a phone scroll sideways inside their frame at 375 px; that is a separate step.
- Freezing the home page (H7) is not done; the structure test
tests/ui/hub.test.jsdoes not exist. - A player who played only Colony does not see the statistics, because the reveal rule reads Kastgard's games.
- A tile for achievements in the hub does not exist; the request concerned only the statistics.
- Previews in the settings (
docs/SETTINGS-PREVIEW.md) are an analysis and a mock-up, not code. - Rokgard's achievements, the wardrobe for tokens and the titles to choose from are not finished.
What could not be verified: the proofs (25 of 26 outputs, mutations, 108 states, the wheel and a game of Lines by clicks) were not run again while writing; they come from the documents and the development notes. The offline mode and printing were not verified. It is not known whether the link in the footer was tried from the hub at step H5b; the document describes it without a realm, and the test was written only with the fix. The breakdown of which step reduced the edges from 120 to 107 was not established. The Russian name of the table after the presets is a machine proposal.
Sources
docs/HOME-FINAL.md (parts 3 to 6 and 9), docs/DESIGN.md §116 to §127 and docs/SETTINGS-PREVIEW.md. The counts of edges come from the tool tools/packages.js --check on game version 0.81.2.