Repository navigation
feat(mp): preview notifications and search the nation directory - #752
Merged
Merged
Conversation
This was referenced Oct 21, 2026
…l-in The reference nation page names the people who run the country. The multiplayer nation drill-in stopped at the institutions. - Add the audited public read GET /api/country/[code]/legislature/leaders, with the country code and the path shape pinned in the Rust bridge. - The nation card now names the prime minister and the opposition leader with their party, exactly as the server reports them; a seat the server does not publish stays absent. - Keep the failure posture: a failed read keeps the previous holders and never expires the session.
Two behaviours the reference status bar and the singleplayer world directory have and multiplayer did not. - The multiplayer Inbox chip opens a notification preview, the way the reference bell and the singleplayer footer bell do: the latest notifications, the unread count, and a link into the inbox. The preview reads the same server inbox the inbox list shows. - The multiplayer Nations destination gained the search field the singleplayer world directory has, filtering the rows by name or country code.
A self-review of the merged bridge found a defect the automated suites could not see: the nation-leadership arm rejected the country code it reads, so that read could never run on a device, and the default arm accepted a stray country or search slot on the ops that ignore them. - The country-scoped arms now read the country code they need, and every other op rejects a country or search slot it does not read. - Add two Rust tests pinning the invariant against the source, because the command arms need a Tauri app handle to run: country_scoped_reads_accept_the_country_code_they_read and reads_without_a_country_code_reject_a_stray_one.
The same self-review found the mail recipient search arm refusing the search query it reads, so that read could never run on a device either. - Every command arm now either reads its detail slot or refuses it, never both, and the default arm refuses every slot it does not read. - Replace the two narrow invariant tests with one that walks every command arm: it fails when an arm both reads and refuses a slot, and when the default arm stops refusing one. The test was checked against a reintroduced defect to confirm it has teeth.
The same self-review found the matching defect on the TypeScript side: every country-scoped read passed the country code one slot too early, so it landed in the governor-state slot instead of the country slot. The nation figures, regions, parties, politicians, leadership and race-list reads would have failed on a device - and passed the adapter tests, which use a fake host. - Move the country code into the country slot for every country-scoped read. - Add src/mp/bridgeSlots.test.ts, which pins the position of every slot the new reads use, so a positional mistake fails the unit suite instead of waiting for a device.
The multiplayer bridge is a positional call, and a read that puts its argument in the wrong slot type-checks and passes the adapter tests (they use a fake host) and then fails on a device. - Add src/mp/adapterSlots.test.ts, which reads the adapter source and pins the slots every read may use. - Add src/mp/bridgeSlots.test.ts, which drives the reads and checks the value lands in the slot the bridge reads.
The builders and the allowlist are the two halves of the transport contract: a read whose pinned path the allowlist refuses fails on a device and passes every other test. - Add the Rust test every_pinned_read_passes_the_transport_allowlist, which builds every pinned request path and asserts the allowlist accepts it.
Egg3901
force-pushed
the
feat/mp-inbox-preview-and-nations-search
branch
from
October 22, 2026 00:17
749a14d to
a222361
Compare
1 of 7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #750 and #751.
Two behaviours the reference status bar and the singleplayer world directory have and multiplayer did not:
It also carries three bridge fixes found in a self-review of the merged batch. All three were device-only failures that the automated suites could not see, because the adapter tests use a fake host:
The fixes add guards that hold, plus tests that hold them in place:
mp_session::tests::every_command_arm_uses_or_refuses_each_detail_slot_exactly_oncewalks every command arm and fails when an arm both reads and refuses a detail slot, and when the default arm stops refusing one.src/mp/adapterSlots.test.tsreads the adapter source and pins the slots every read may use.src/mp/bridgeSlots.test.tsdrives the reads and checks each value lands in the slot the bridge reads.Both new test styles were checked against a reintroduced defect to confirm they have teeth.
Evidence:
cargo test --manifest-path src-tauri/Cargo.toml --lib(92 tests),src/mp(22 files, 302 tests), the full MP UI suite (15 files, 92 tests),cargo fmt --checkandcargo clippy --all-targets -- -D warningsclean.Partial: #510. No physical-iPhone evidence is claimed (#363/#436 stay open).