Skip to content

Systems 8b: the current project is state the window follows - #120

Open
Pelotrio wants to merge 4 commits into
claude/systems-workersfrom
claude/systems-project
Open

Pelotrio wants to merge 4 commits into
claude/systems-workersfrom
claude/systems-project

Conversation

@Pelotrio

@Pelotrio Pelotrio commented Sep 30, 2026 •

Copy link
Copy Markdown
Member

Second part of the last step of docs/SYSTEMS.md (8b), stacked on #119: the current project is state the window follows, instead of the application relaying the current project's changes to the UI after checking which project they came from.

Finish line

Behavior Test
A follower hears only the current project, moves to the next one on a switch, and hears nothing once it stopped CurrentProjectTest.aFollowerHearsOnlyTheCurrentProjectAndMovesWithASwitch
A change the previous project told just before a switch is not told after it the same test (fails without the check in CurrentProject.follows)
A queued change is ignored after stopping, and a switch during initial binding is followed CurrentProjectTest
Switching and reopening projects through the application still reaches the window ApplicationNavigationTest, ProjectSwitchLifecycleTest

What changes

  • CurrentProject holds the project Companion shows and fires when another becomes current. follows(scope -> signal, told) follows that signal of whichever project is current, moves on a switch, and delivers on the Swing thread only while that project is still current, so no follower checks where a change came from. Stopping rejects queued deliveries and pending rebinding; registration precedes the initial binding so a concurrent switch cannot be missed.
  • CompanionApplication.makeCurrent, the one place the current project changes, publishes it to CurrentProject. The application's lifecycle keeps reading its own field under its lock.
  • The main window follows the current project's catalog and change record itself. CompanionUi.catalogChanged and changesRecorded, and the application's two relays with their scope checks, go.

Left as it is

  • The Project tree still subscribes to the world, the game and the datapacks of the project it shows, and checks the project when told. It lets go of them when it shows another project; moving it to CurrentProject.follows would change how seven tests build it, for the same behavior.
  • Building the tree's roots checks whether the scripts and saves folders exist and whether the game wrote logs, on the Swing thread: a few metadata reads on a local disk.

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:20:19.291484Z 6bc0856 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: cdb9f538ff

ℹ️ 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".

Comment on lines +48 to +50
fromScope[0] = now == null ? () -> { } : signal.apply(now).subscribe(() -> SwingUtilities.invokeLater(() -> {
if (this.scope == now) told.run();
}));

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 Prevent callbacks after stopping a follower

When a project signal races with MainWindow.dispose(), its EDT lambda may already be queued even though the returned stop action removes the subscriptions; this check only verifies that the project is still current. If the scope remains current, catalogChanged or changesRecorded therefore runs after disposal and can repopulate the disposed FileTreeView or attach fresh listeners. Track the subscription's stopped state or generation here and reject queued deliveries after it is stopped.

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

Useful? React with 👍 / 👎.

Comment on lines +53 to +54
move.run();
Runnable fromProject = this.changed.subscribe(move);

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 Close the switch gap before subscribing

follows binds to the current scope before registering for project changes. If openProject completes a switch during MainWindow construction between these statements, set fires while there is no project-change listener; the later checkWindowCreation can pass once switching is finished, but the catalog/change followers remain attached to the retired scope, so subsequent changes in the project displayed by the window never refresh its tree or tabs. Make the initial binding and change subscription atomic, or recheck the scope after subscribing.

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

Useful? React with 👍 / 👎.

@Pelotrio
Pelotrio force-pushed the claude/systems-workers branch from 731197c to c7926a4 Compare September 30, 2026 16:38
@Pelotrio
Pelotrio force-pushed the claude/systems-project branch from 03ba0b4 to d7be006 Compare September 30, 2026 16:42
@Pelotrio
Pelotrio force-pushed the claude/systems-workers branch from c7926a4 to 9c9c5db Compare September 30, 2026 17:01
@Pelotrio
Pelotrio force-pushed the claude/systems-project branch from d7be006 to 90b90b9 Compare September 30, 2026 17:01
CurrentProject holds the project Companion shows; its follows moves a follower
to the next project on a switch and drops what the project before told. The
application publishes the current project from makeCurrent, and the main window
follows the current catalog and change record itself, so CompanionUi's two
relays and their scope checks go. A log navigation that finds its file listed
supersedes an earlier one still looking.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@Pelotrio
Pelotrio force-pushed the claude/systems-workers branch from 9c9c5db to e5e3da3 Compare September 30, 2026 17:11
Pelotrio and others added 2 commits September 30, 2026 19:11
…ecided

The configuration and resource files have no owner that reads them, so the
Changes page's read remains what drops a change put back outside Companion.
The step that would have moved it into the owners, with connection numbers,
goes.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@Pelotrio
Pelotrio force-pushed the claude/systems-project branch from 90b90b9 to 3a12518 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