Skip to content

fix: show the admin terms and reserve buttons inside their cards - #30

Merged
epoberezkin merged 1 commit into
simplex-chat:simplexfrom
brenzi-agent:ab/admin-terms-button-overflow
Nov 26, 2026
Merged

epoberezkin merged 1 commit into
simplex-chat:simplexfrom
brenzi-agent:ab/admin-terms-button-overflow

Conversation

@brenzi-agent

Copy link
Copy Markdown

On /admin at 1280 px, four controls are drawn past the right border of their cards (border at x = 1024 px):

Card Control x from–to
Reserved Names Reason 919–1045
Reserved Names Reserve 1061–1144
General Terms Set general terms 999–1147
Community Names Set community terms 999–1166

At 390 px, the same controls end at 483–582 px, past the right edge of the screen, and the page scrolls sideways (document width 582 px).

Cause

  • Each of these controls follows an Input in a Row, a flex row without wrapping (admin.tsx L147-L153):
    • the terms link input, with a description of 140 characters (L205-L223);
    • the reserve input, with a description of 89 characters, then Reason and Reserve (L527-L553).
  • Thorin 1.0.0-beta.28 renders an input's description on one line (Field.tsx L220-L230, Typography.tsx L33-L36) and sets the input to the full width of its container (Field.tsx L285).
  • A flex item is shrunk no further than its content-based minimum size, "the larger of the content size suggestion and the transferred size suggestion (if one exists), capped by the specified size suggestion" (CSS Flexbox 1, § 4.5). The one-line description of the terms link is 907 px wide, so the input keeps the full width of the row (686 px), and the button after it is placed past the card. The reserve input box stays 604 px wide, and Reason and Reserve follow it.
  • point the .simplex dApp at the v2 mainnet contracts #23 lengthened the terms description from 67 characters (455 px, which fit beside the 148 px and 167 px buttons) to 140. support new contracts for simplex tld #3 placed Reason between the reserve input and Reserve.

Change (diff without whitespace)

  • src/pages/admin.tsx: the Row around the terms link input and its button, and the Row around the reserve input, Reason and Reserve, are removed. These controls are stacked in the card's column at full width, as in "Register Reserved Name".
  • 4 lines are removed; the other changed lines are re-indented. Texts, styles, test IDs, the tab order and the other rows are unchanged.
  • While the Reason menu is open, it lies over Reserve; on the base, it lies over the right end of Unreserve. Thorin closes the menu on a choice or on a click outside it.

Evidence

Production builds of the base 596bc1c and the head 6b8abc8 on anvil 1.5.1 with the chain state of the visual tests (ab/e2e-visual at cda6a1b), Chromium of Playwright 1.50.1, owner account #0 connected.

  • 1280×1000, before and after:
    admin-1280
  • 390×844, before and after:
    admin-390
  • Every button, input and combobox of the eight admin cards, measured against the right edge of its card's content (x = 983 px at 1280 px, 341 px at 390 px):
    • at 1280 px, the four controls above end past it on the base, and none on the head;
    • at 390 px, the same four and Unreserve end past it on the base, and Unreserve alone on the head.
  • The other five cards (Controller State, Contracts in use, Check Reserved Name, Min Character Length, Register Reserved Name), and the terms cards above the link input, differ between the builds by at most 2 of 255 per channel, in anti-aliased rounded corners and in the fade at the bottom of the terms text. Two runs of one build give identical images.
  • A unit test cannot show the defect: jsdom computes no layout, and admin.test.tsx clicks both terms buttons by test ID on the base too.
  • CI at 6b8abc8: Test (2145 tests, three builds) and Knip pass.

Alternative: min-width: 0 on a wrapper of each input keeps the controls beside the input. It cuts the visible descriptions to "The raw link of one file at a full commit hash on…" and "Newline or comma separate…" at 1280 px, and leaves the reserve input 49 px wide at 390 px.
alternative-1280 alternative-390

Left as they are (on the base too):

  • The terms description is cut after "ending" at 1280 px, and earlier at 390 px; the cut part names the #sha256= suffix of the link. Thorin cuts every input description to one line.
  • At 390 px, Unreserve ends 29 px past the right edge of the content of Reserved Names, inside the card's border; the cause is the same.
  • At 390 px, the addresses in Controller State run past the screen; the document is 430 px wide on the head.

Visual tests: once this and the visual tests are both merged, reserved.png, general-terms.png and community-names.png of account.spec.ts need new baselines.

@epoberezkin
epoberezkin merged commit 30b2c6a into simplex-chat:simplex Nov 26, 2026
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.

2 participants