Skip to content

feat: gather identity operations under a Manage Identity menu - #35

Merged
PastaPastaPasta merged 2 commits into
mainfrom
t3code/consolidate-manage-identity
Sep 1, 2026
Merged

feat: gather identity operations under a Manage Identity menu#35
PastaPastaPasta merged 2 commits into
mainfrom
t3code/consolidate-manage-identity

Conversation

@PastaPastaPasta

Copy link
Copy Markdown
Member

The init screen had grown to seven entries, three of which were different operations on an identity you already own. Those now live behind a single Manage Identity button, taking the init screen down to five.

Before / after

INIT (before, 7)                      INIT (after, 5)
  Create New Identity                   Create New Identity
  Top Up Existing Identity              Send to Platform Address
  Send to Platform Address              Register Username
  Register Username                     Manage Identity  ──┐
  Manage Identity Keys                  Register Data Contract
  Register Data Contract                                   │
  Withdraw Credits                                         │
                                                           ▼
                                      MANAGE IDENTITY
                                        Top Up Identity
                                        Manage Keys
                                        Transfer a Username
                                        Withdraw Credits
                                        Back

The chooser step (manage_choose_action) already existed from #34; this extends it rather than adding a new screen.

The part worth reviewing

Manage Keys and Transfer are steps within mode: 'manage'. Top Up and Withdraw are their own BridgeModes, so entering them from the menu has to go through setMode, which resets mode-scoped state.

That creates a back-navigation problem: Back from top-up previously meant "return to init", and it still must for anyone who arrived another way. A new fromManageMenu flag records the entry point:

  • setManageActionTopUp / setManageActionWithdraw do { ...setMode(state, …), fromManageMenu: true }.
  • clearModeSensitiveFields clears it, so any mode entered from the init screen or a deep link starts without it. It is set after the clearUsernameTransferFields spread, which would otherwise reintroduce the old value.
  • The generic #back-btn and #withdraw-back-btn handlers branch on it.

This matters because ?mode=withdraw is an existing deep link — a user who lands there directly must not be sent "back" into a menu they never visited. There is a test pinning that.

Testing

  • Two new deterministic Playwright tests: one walks the menu, checks all four entries are present and that Back from both Top Up and Withdraw returns to the menu (while Back from the menu itself exits to init); the other deep-links ?mode=withdraw and asserts Back exits to init instead. Suite: 8 passing.
  • Existing top-up, withdraw, manage-keys and transfer tests updated for the new navigation. tsc, 108 unit tests, production build and the artifact check all clean.
  • Also fixed two opt-in live specs (live.testnet, live.transfer) that clicked the removed #mode-topup-btn. CI does not run those, so they would have broken silently.

No behaviour changes inside any of the four flows — only how they are reached and where Back goes.

🤖 Generated with Claude Code

The init screen had grown to seven entries, three of which were different operations on an identity you already own. Top Up, Manage Keys, Transfer a Username and Withdraw Credits now live behind a single Manage Identity button, taking the init screen down to five.

Top-up and withdraw are their own BridgeModes rather than steps of manage mode, so entering them from the menu goes through setMode and records fromManageMenu. Back then returns to the menu instead of dropping the user out to the init screen. The flag is cleared by clearModeSensitiveFields, so ?mode=withdraw still deep-links straight in and its Back still exits to init — covered by a new test.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 1, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 7 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Team

Run ID: 49586b09-a4bc-42b3-b5c8-70e6375891d3

📥 Commits

Reviewing files that changed from the base of the PR and between 95ebba0 and 075cfdd.

📒 Files selected for processing (8)
  • e2e/deterministic.spec.ts
  • e2e/live.testnet.spec.ts
  • e2e/live.transfer.spec.ts
  • src/main.ts
  • src/types.ts
  • src/ui/components.ts
  • src/ui/index.ts
  • src/ui/state.ts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Four transitions assign mode directly instead of going through setMode, so they skip clearModeSensitiveFields. None of them is reachable with fromManageMenu set today, but that relied on a reachability argument rather than the code enforcing it. Clearing the flag at each site makes the invariant -- only topup and withdraw can carry it -- hold structurally, so a future step added to those paths cannot silently send a user back to a menu they never opened.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@PastaPastaPasta
PastaPastaPasta merged commit 2333006 into main Sep 1, 2026
3 checks passed
@PastaPastaPasta
PastaPastaPasta deleted the t3code/consolidate-manage-identity branch September 1, 2026 22:02
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