Skip to content

feat(mp): preview notifications and search the nation directory - #752

Merged
Egg3901 merged 7 commits into
mainfrom
feat/mp-inbox-preview-and-nations-search
Oct 22, 2026
Merged

Egg3901 merged 7 commits into
mainfrom
feat/mp-inbox-preview-and-nations-search

Conversation

@Egg3901

@Egg3901 Egg3901 commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator

Follow-up to #750 and #751.

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.

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:

  1. The nation-leadership command arm rejected the country code it reads, so that read could never run on a device.
  2. The mail recipient search arm rejected the search query it reads, for the same reason.
  3. 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 all have failed on a device.

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_once walks 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.ts reads the adapter source and pins the slots every read may use.
  • src/mp/bridgeSlots.test.ts drives 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 --check and cargo clippy --all-targets -- -D warnings clean.

Partial: #510. No physical-iPhone evidence is claimed (#363/#436 stay open).

…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
Egg3901 force-pushed the feat/mp-inbox-preview-and-nations-search branch from 749a14d to a222361 Compare October 22, 2026 00:17
@Egg3901
Egg3901 merged commit 8963f16 into main Oct 22, 2026
1 check passed
@Egg3901
Egg3901 deleted the feat/mp-inbox-preview-and-nations-search branch October 30, 2026 21:57
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