Frun1na opened a new pull request, #6776:
URL: https://github.com/apache/rocketmq-dashboard/pull/6776
### Which Issue(s) This PR Fixes
- Fixes #6774
### Brief Description
`web/src/pages/instance/index.tsx` is the last table still on the pre-#6633
timestamp width: the created/updated columns (lines 650 and 665) declared
`width: 150` for a 19-character `YYYY-MM-DD HH:mm:ss` cell, worth 156px in a
`size="small"` table (140px label + 8px padding per side) — the figure #6633
applied to the same 150px column in `alerts.tsx` and to `dlq.tsx` /
`systemAlerts.tsx`. Neither column carries `ellipsis`, so at 134px of content
box the value wrapped at its own space and every row grew to two lines. The
action column (line 678) declared `width: 150` for a right-aligned pair of 66px
buttons plus a 6px gap and 16px of cell padding — 154px — so the pair
overflowed 4px left into the updated-time column. Both columns now declare
their measured content width (156 / 156 / 154); the 16px of extra declarations
stay below the 1600px viewport's container width and the surplus is absorbed by
the two unsized columns (instance id, remark), so no table gains a horizontal s
crollbar.
### How Did You Test This Change?
```
$ ./wb test --tree worktrees/rocketmq-dashboard/instance-table-widths
✓ npx eslint src/pages/instance/__tests__/InstancePage.test.tsx
src/pages/instance/index.tsx
✓ npx prettier --check src/pages/instance/__tests__/InstancePage.test.tsx
src/pages/instance/index.tsx
✓ npx vitest related --run
src/pages/instance/__tests__/InstancePage.test.tsx src/pages/instance/index.tsx
✓ npx tsc -b
$ npx vitest run src/pages/instance/__tests__/InstancePage.test.tsx
Test Files 1 passed (1)
Tests 35 passed (35)
```
The new test fails without the fix:
```
$ npx vitest run src/pages/instance/__tests__/InstancePage.test.tsx
FAIL src/pages/instance/__tests__/InstancePage.test.tsx >
declaresTheTimestampAndActionColumnsWideEnoughTest
Expected: "156px"
Received: "150px"
❯ src/pages/instance/__tests__/InstancePage.test.tsx:189:29
expect(widthOf('创建时间')).toBe('156px');
Test Files 1 failed (1)
Tests 1 failed | 34 passed (35)
```
The assertion reads the rendered `<colgroup><col style="width: …">`, which
is exactly the value the fix changes: reverting the three declarations to 150
turns the timestamp assertion back to red, because the column definition no
longer carries the 156 the cell's label needs.
### Checklist
- [x] One coherent change; unrelated modifications are not bundled in
- [x] Commit subject follows Conventional Commits (`feat:` / `fix:` /
`refactor:` / `chore:` / `docs:` / `perf:`)
- [x] Tests added or updated for non-trivial changes, test methods named
`...Test`
- [ ] New UI text has both Chinese and English entries under `web/src/i18n/`
- [ ] Architecture constraints stay green (`mvn test` runs the ArchUnit
checks)
- [ ] New source files carry the ASF license header
- [ ] Documentation touched where behaviour changed (README / `docs/` /
in-app help)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]