fix(packets): align Unified Packet Monitor headers with columns#3567
Conversation
The body rows use display:table + tableLayout:fixed (required for absolute-positioned virtualization), which makes each <tr> its own table — so the body <table>'s <colgroup> does not propagate to the rows. The header table honored the colgroup while body cells equal-distributed, leaving headers misaligned with their columns. Add explicit per-cell widths to every <th> and <td> (matching the colgroup), mirroring the working single-source PacketMonitorPanel, so fixed-layout rows size identically to the header. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Peq865k9vuH4PvKTFhQuNq
|
Claude finished @Yeraze's task —— View job PR Review: fix(packets): align Unified Packet Monitor headers with columnsTasks:
SummaryThis is a well-targeted, minimal fix for a real layout bug caused by the interaction between Code Quality ✅The approach is correct and idiomatic — matching explicit One minor observation: The // These colgroup entries no longer affect layout for display:table rows —
// widths are now controlled by the explicit width on each <td>.
<colgroup>
<col style={{ width: '50px' }} />
...
</colgroup>Potential Bugs 🟡Width consistency between Loader row (
Performance ✅No performance concerns — the change is purely presentational. Inline style objects on Security ✅No security concerns. This is a pure layout fix with no data handling, API calls, or user-input processing. Test Coverage 🟡The PR notes all 7491 unit tests pass. There are no new tests for the layout fix, which is expected — pixel-level column alignment is impractical to unit test with Vitest/Testing Library. Manual verification in the dev container (documented in the PR) is the appropriate testing strategy here. The existing Minor Suggestions (non-blocking)
const COLUMN_WIDTHS = ['50px', '120px', '35px', '45px', '55px', '110px',
'140px', '140px', '120px', '70px', '60px', '60px', '60px', '60px', '200px'] as const;This is a refactor for a follow-up, not a blocker. VerdictThe fix is correct, minimal, and well-explained. The only non-trivial note is the now-redundant |
Summary
The Unified Packet Monitor's column headers no longer lined up with the data beneath them. The fix makes the virtualized body rows size identically to the sticky header row so every header sits directly above its column.
Root cause
The stream uses the standard two-table virtualization pattern: one
<table>for the sticky header and a second for the virtualized body, with each body<tr>given inlinedisplay: table; tableLayout: fixedso@tanstack/react-virtualcan absolutely position it. When a<tr>becomesdisplay: tableit forms its own table box, so the body<table>'s<colgroup>no longer propagates to the row. Column widths in this page came only from the colgroup and the<th>/<td>cells carried no widths — so the header table honored the colgroup while each body row fell back totableLayout: fixedequal-distribution, leaving headers misaligned.The single-source
PacketMonitorPaneldoes not have this bug because it sets an explicitwidthon every<th>and<td>.Changes
width(matching the existing<colgroup>) to all 15<th>cells in the header row ofUnifiedPacketMonitorPage.tsx.widthto all 15<td>cells in each virtualized body row, merging with existing inline styles (e.g.packet-numbertext-align,portnumcolor).Issues Resolved
None (reported directly).
Documentation Updates
No documentation changes needed — internal layout fix with no behavior or API change.
Testing
npm run typecheck)🤖 Generated with Claude Code