Skip to content

Add character: one card per character, connect logs in as it, vault checkbox - #43

Merged
MHohlios merged 2 commits into
mainfrom
wiffletree/add-character-one-card-per-character-connect-log
Nov 4, 2026
Merged

MHohlios merged 2 commits into
mainfrom
wiffletree/add-character-one-card-per-character-connect-log

Conversation

@MHohlios

@MHohlios MHohlios commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Until now, every card on a server logged in as the last character played there, so there was no way to play a second character on the same server. Now each character has its own card and connects as itself. You add a character, not a server: pick its server from a pull-down and tick whether MUDling keeps its password in the vault. Linear: VYT-268.

Changes

  • Connect as the character.
    • Target now carries the character. launcher::login_for sends the saved password if the vault holds one; otherwise it sends only the name, and you type the password at the game.
    • Quick connect still sends nothing.
    • While you're connected, choosing another character asks "Log out X and connect Y?" and reconnects only if you confirm. Choosing the character in play just brings the window forward, including when the game named you after a server-card or Quick connect login.
    • The session menu lists the other characters on the same server.
    • Restarting to update logs back in as the same character (--character alongside --reopen).
  • Where to today?
    • One card per character, newest played first: name, server, level, last played, and a tag that reads "Password saved", "You type the password" or, while the vault is locked, "Vault locked".
    • A server with no character keeps its server card.
    • "Add character" replaces "Add a server".
  • Add / Edit character dialog.
    • Fields: Name; Server (saved servers, then "New server…" with an Address field); Password; and "Save the password in MUDling's vault".
    • The box ticks itself once you type a password, until you click it yourself.
    • With no vault yet, Add with the box ticked runs the vault's create step, then saves the password. With a locked vault, it runs the unlock step instead.
    • A name already on the server says so and offers Edit.
  • Settings → Servers & characters.
    • Characters are grouped by server. Each server header has Plugins and Remove server; each character has Edit and Remove.
    • Unticking the box in Edit deletes the vault entry.
    • Remove asks first, deletes the saved password and keeps stats and history.
    • Settings → Vault loses "Add a password".
  • Vault: password changes run one at a time. A change made while another vault job is running is queued, never dropped.
  • Sync: an added character is an ordinary character row. A removal is the synced meta key character.removed.<id>, honoured only while it is newer than the character row, so adding the character again or playing it brings it back.
  • Accessibility: new --ax-check stops cover Add character with both server choices, the grouped Servers page and the switch question. docs/accessibility.md is updated.

Checks

  • cargo fmt --check and cargo clippy --workspace --all-targets --release --locked -- -D warnings are clean.

  • cargo test --workspace --no-fail-fast --locked passes, 1807 tests at review.

  • Release --synthetic --ax-check passes all its checks.

  • New tests cover:

    • two characters on one server each log in as themselves;
    • a character without a saved password sends only its name;
    • switching asks, then reconnects;
    • add with the box ticked, unticked and with no vault;
    • the box's default;
    • Edit unticking deletes the password;
    • Remove deletes the password and keeps history;
    • overlapping password changes both land;
    • an add and a removal sync between two devices.

    None of them depend on timing.

  • Frame p99, release build: Where to today? 4.6 ms, Servers page 5.7–5.9 ms. The budget is 8 ms.

Follow-ups

  • Settings dialogs copy each other's scaffolding (pane setup, dialog frame, action row); share begin_pane, alone_dialog and actions() in settings/mod.rs (crates/mudling-desktop/src/settings/character.rs:654).
  • Add character with "New server…" and a host that's already saved silently ignores the port typed (crates/mudling-desktop/src/launcher.rs:75).

Reviewed with Wiffletree: 1 full review and 1 re-check, 2 rounds (Tests, Claude, Style)

mhohlios added 2 commits November 4, 2026 15:43
…heckbox

A connect target now carries its character. A character's card logs in as
that character, with its saved password if the vault holds one, and
otherwise answers only the name. Quick connect sends nothing. While one
character is connected, choosing another from the session menu asks "Log out
X and connect Y?" first.

Where to today? shows one card per character, each tagged with whether its
password is saved, and "Add character" replaces "Add a server". The Add
character dialog picks the server from a pull-down with "New server…" last,
and its "Save the password in MUDling's vault" box sets up the vault first
when there is none. Settings → Servers & characters groups characters under
their server, with Edit and Remove. Settings → Vault loses "Add a password".

Removing a character writes a synced `character.removed.<id>` meta row, so
the removal reaches other devices while the character's stats and history
stay. A restart to update reopens the server as the same character.

Adds --ax-check stops for the dialog with both server choices and for the
switch question, and broadens the Servers page stop. Adds --where-to-today
and --settings-section servers to measured runs.
…lay by name

A password change asked while a vault job runs now waits in a queue and
starts when that job finishes, instead of dropping the job in flight. A
dropped job could delete the old password without saving the new one.

Choosing a character from the session menu is the one in play when the
server matches and the game named that character. That holds even when the
game was opened from a server card, so it no longer asks "Log out Bren and
connect Bren?".

The remove question now says the removal reaches every synced device. Adds
persist::character_id and EntryKey::is_for so the dialog, the card tags and
login share one rule. add_character takes the character's name. Adds tests
for removing a character with a vault, the vault box's default, overlapping
password changes, and the named character in play.
@MHohlios
MHohlios merged commit 58f1a95 into main Nov 4, 2026
5 checks passed
@MHohlios
MHohlios deleted the wiffletree/add-character-one-card-per-character-connect-log branch November 4, 2026 21:18
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