Skip to content

Systems 7: every page reads through page and follows - #118

Open
Pelotrio wants to merge 2 commits into
claude/systems-readingsfrom
claude/systems-pages
Open

Pelotrio wants to merge 2 commits into
claude/systems-readingsfrom
claude/systems-pages

Conversation

@Pelotrio

@Pelotrio Pelotrio commented Sep 30, 2026 •

Copy link
Copy Markdown
Member

Seventh PR of docs/SYSTEMS.md, stacked on #117: every page reads through the one PageLoader way, page and follows, and the older modes and ShownUpdates go.

Finish line

Behavior Test
The World tab names the world the game plays while its page is hidden, and the hidden page reads nothing for it PageReadsTest.theWorldTabNamesTheWorldTheGamePlaysWhileItsPageIsHidden
When the game plays another world, followers of the world's owner find it read when told WorldReadingTest.whenTheGamePlaysAnotherWorldItsFollowersFindItsNamePublished (fails without the change)
A redraw from memory waits while the page is hidden, runs once when shown, and not after the page closed PageLoaderTest.anUpdateFromMemoryWaitsWhileThePageIsHiddenAndRunsOnceWhenShown
A tab's title is redrawn while its page is hidden PageLoaderTest.aTitleIsRedrawnWhileThePageIsHidden
A page reading whenever shown waits while hidden; a part of a page reads when chosen PageLoaderTest.aPageReadWheneverShownWaitsWhileHidden, aPartOfThePageReadsWhenItIsChosenAndChangesFollowWhileThePageIsShown
The Changes, configuration and pack configuration pages read once shown, as tabs show them ChangesPanelTest, ConfigPanelTest, PackConfigurationPanelTest (their pages are shown now)
No page keeps an old mode SystemsRulesTest; PageLoader runs its reads on the file workers, so its exception is gone

What changes

  • PageLoader keeps one way: page, follows, hold/release, and readsWhenShown for the pages whose files others write and only they read. whenShown, waitsWhileHidden and follow(Function) go. It gains updates(signal, redraw) for redraws from memory, PageLoader.redraws(page) for a page with nothing to read, and retitles(signal, redraw) for what shows outside the page. Reads run on the file workers.
  • ShownUpdates goes; its users (Logs, Content, Mod, World, definition details, subject pages) redraw through their loader.
  • Pages: Changes, Logs, configuration, pack configuration, pack, resource packs, Mod, World and definition details use page and follows. None reads in its constructor, and navigation no longer refreshes the Changes and pack configuration pages. The Logs page reads again only when a navigation asks for a log it does not list yet, as a crash report written since.
  • Log navigation clears an older pending selection when the requested file is already listed.
  • ChangeLabels.follows() names the signals of values that change outside the record, instead of taking a listener.
  • resourcesRead, what Mod pages and definitions follow for the game reading its resources again, is a Signal.
  • The World tab follows connection changes as well as world changes, so disconnecting retitles a hidden server tab. It names the world from its owner's published value, redrawn when the owner or what the game plays changes, whether the page is shown or not. WorldReading tells its followers of another world once that world was read, and FileReading.published() gives the value read last without reading.
  • docs/SYSTEMS.md describes the redraws, and moves the Project tree, the CompanionUi relays, ChangeRecord.observed and the Changes page's read whenever shown to PR 8, with the current project as state and the write queue they need.

Left as it is

  • The Changes page reads whenever it is shown until the owners notice values put back outside Companion (PR 8).
  • The configuration page reads again after its own save, through its writer; the configuration files have no owner that reads them.
  • No test holds ExternalEdits' strand busy, so its take check is covered by review, not by a test.

Focused :companion:test checks pass locally. CI runs the full build for the updated head.

🤖 Generated with Claude Code

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-30T17:19:18.012661Z d4e9891 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d5e7629fe9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

if (this.saved != null || this.server != null) this.datapacks.setPacks(this.datapackList, this.catalog.index().orElse(null));
})
// The tab names the world the owner read, also while the page is hidden.
.retitles(world.changed(), this::refreshTitle).retitles(edits.location().playingChanged(), this::refreshTitle);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Retitle the World tab when the connection ends

When a multiplayer connection drops without first receiving a Menu payload, GameLocation.disconnected() clears playing() but fires only connectionChanged(). This loader listens for title changes only on playingChanged() and world.changed(), and the latter need not fire when the previously published local world remains unchanged, so a hidden World tab can retain the disconnected server's address indefinitely. Retitle on connectionChanged() as well.

AGENTS.md reference: AGENTS.md:L19-L19

Useful? React with 👍 / 👎.

Comment on lines +202 to +204
if (index >= 0) {
this.fileList.setSelectedIndex(index);
return;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Clear the older pending log selection

When a request for an unlisted crash report has set this.wanted and started a listing, a newer request for a file already present in this.files takes this branch but leaves the older wanted value intact. When the in-flight listing completes, showFiles() consumes that stale value and selects the older file again, so rapid navigation can make an older request override the newer one. Clear or replace the pending request before returning from this branch.

Useful? React with 👍 / 👎.

Pelotrio and others added 2 commits September 30, 2026 19:11
PageLoader keeps page, follows, hold and readsWhenShown, and gains updates,
redraws and retitles for work from memory; whenShown, waitsWhileHidden,
follow(Function) and ShownUpdates go, and reads run on the file workers. No
page reads in its constructor or because a navigation showed it. The World tab
names the world from its owner, also while its page is hidden, and the owner
tells of another world once it was read. An external edit's take gives way to
a later write.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@Pelotrio
Pelotrio force-pushed the claude/systems-pages branch from c827f12 to d4e9891 Compare September 30, 2026 17:11
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