Skip to content

Adopt idlerthing's table layout and make headers sortable - #19

Merged
AlteredParadox merged 4 commits into
mainfrom
table-refresh
Nov 19, 2026
Merged

AlteredParadox merged 4 commits into
mainfrom
table-refresh

Conversation

@AlteredParadox

Copy link
Copy Markdown
Owner

Brings the tables in line with idlerthing's server inventory, and adds click-to-sort headers.

What changed

  • Row height: every row is one line at a fixed height (30px, 25px in compact). Cells no longer wrap. The hosts table shows the DNS name inline after a hostname override instead of on a second line.
  • Long text: comments, event details and tags clip with an ellipsis and keep the full text in the title. The free-text column takes whatever width is left over.
  • Links: table links are plain text colour, and turn blue and underlined on hover. MAC addresses are muted.
  • Header: a smaller, bolder uppercase strip on its own shade.
  • Up column: the up/total bar sits inline after the numbers, lined up across rows, and is green.
  • Font size: table text is 13px (12px in compact), up from 12px and 11px.
  • Sorting: every column header except the checkbox and action columns sorts on click, with an arrow and aria-sort on the active column.
    • IP and CIDR columns sort by a server-built key (ipKey template helper), so .9 comes before .10 and IPv4 before IPv6.
    • Time columns sort newest-first on the first click.
    • Empty values always stay at the bottom.
    • The choice is kept per table in sessionStorage, so saving a row edit doesn't reset it.

Worth knowing

  • Sorting is client-side, so on the paginated events page it reorders only the events on the current page.
  • sonar-project.properties gains a coverage exclusion for internal/web/static/**, the same one ircthing, idlerthing and pmss-fleet-manager carry. The script is still analysed for bugs and smells.
  • The nav padding is tightened under 820px so "logout" stays on the first row at phone width.

Testing

  • make vet, make license-check, make notices-check and go test ./... pass locally. New tests cover the IP sort key's ordering and the sort markup on a rendered page.
  • Checked in headless Chromium against a seeded demo database: sort order for IP, hostname, status and time columns, sort persistence across a reload, uniform row height on every table (including a row in inline-edit mode), no table overflow at 1440px, and no page overflow at 420px. Dark, light and compact + full width all checked; no console errors.

🤖 Generated with Claude Code

Bring the tables in line with idlerthing's server inventory.

- Every row is one line at a fixed height (30px, 25px in compact).
  Cells no longer wrap; long comments, event details and tags clip
  with an ellipsis and keep the full text in the title. The free-text
  column takes whatever width is left over.
- The hosts table shows the DNS name inline after an override instead
  of on a second line.
- Table links are plain text colour, and turn blue and underlined on
  hover. MAC addresses are muted.
- Headers are a smaller, bolder uppercase strip on their own shade.
- The up/total bar sits inline after the numbers and is green.
- Table text is 13px (12px in compact), up from 12px and 11px.
- Headers sort on click, with an arrow on the active column. IP and
  CIDR columns sort by a server-built key so they order numerically,
  time columns sort newest-first on the first click, and empty values
  stay at the bottom. The choice is kept per table for the browser
  session so saving a row edit doesn't reset it.
- Exclude the browser script from Sonar coverage, as the sibling
  repos do; it has no test harness.
- Keep "logout" on the first nav row at phone width.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-19T01:59:58.329023Z 652c479 Manual request
🔒 Security Review ✅ Completed 2026-11-19T01:46:35.481755Z d4f9089 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d4f9089630

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/web/router.go Resolved

Copy link
Copy Markdown
Owner Author

fred review: d4f908963045dc625a9247ccd3db83a3949a7c47

  • P3 · Put an explicit address-family prefix in IP sort keys (internal/web/router.go, ipSortKey). As16() maps IPv4 into the middle of IPv6 space, not before every IPv6 value. For example, ::1 and ::/0 sort before IPv4 ascending, contrary to the documented ordering and the intent of the current test. Prefix the keys by family and add a low-IPv6 case.
  • P3 · Keep clipped event details readable without hover (templates/events.html, templates/host.html). The new clipping makes full event details available visually only through a title tooltip on a non-focusable cell. Keyboard-only and touch users cannot reliably reveal that text on the host history screen. Add a focusable expand control or let details wrap on demand.

Static review only. Codex is pending. The new browser sorting code is outside Sonar coverage due to the added exclusion.

Review findings on PR #19.

- ipSortKey now leads with the address family. As16 alone places IPv4 at
  ::ffff:a.b.c.d, in the middle of IPv6 space, so ::1 and ::/0 sorted
  before every IPv4 address and ::ffff:10.0.0.1 collided with 10.0.0.1.
  The ordering test gains low-valued and IPv4-mapped IPv6 cases.
- A table cell whose text is actually cut off becomes a toggle: click,
  Enter or Space wraps the full text in place. Reading clipped comments
  and event details no longer depends on a hover tooltip, which keyboard
  and touch users cannot reach. Cells that fit get no tab stop, and the
  cell keeps its table role so screen readers still read it in column.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@AlteredParadox

Copy link
Copy Markdown
Owner Author

claude: both fred findings on d4f9089 are addressed in 8b8ab44.

  • IP sort keys: ipSortKey now leads with the address family, so IPv4 orders before all of IPv6 (including ::1 and ::/0), and IPv4-mapped IPv6 no longer collides with plain IPv4. The test covers those cases.
  • Clipped details: any table cell whose text is actually cut off is now a toggle. Click, Enter or Space wraps the full text in place, so reading it no longer depends on the title tooltip. Cells that fit get no tab stop. The cell keeps its table-cell role, since the text is only clipped visually and a screen reader already reads all of it.

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

Reviewed commit: 8b8ab444e2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link
Copy Markdown
Owner Author

fred review: 8b8ab444e2a8a28eb8eb1c8efec857276e8d1e7d

Mixed-family sort is fixed and regression-tested. The normal clipped-cell path now supports click, Enter, and Space. One remaining P3 in bindClip: clip detection runs at DOM ready and on window resize, but the shipped fonts use font-display: swap. If a font swap changes whether the text overflows without a resize, a newly clipped cell can remain untabbable. Recheck after document.fonts.ready (or observe the affected cell sizes) so the keyboard toggle stays available after font loading.

Static review only. Current-head Codex and CI were pending during review; Codex Security covered the previous head.

Review finding on PR #19: clip detection ran only at DOM ready and on
window resize. The embedded font uses font-display: swap, so a swap
after first paint could leave a newly cut-off cell without its keyboard
toggle.

Re-measure when document.fonts settles and whenever a clip cell changes
size (ResizeObserver). Also re-measure after clicks and typing: a row
entering edit mode swaps the cell's text for an input without changing
the cell's size, which left a stale tab stop on the cell being edited.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@AlteredParadox

Copy link
Copy Markdown
Owner Author

claude: the remaining fred P3 on 8b8ab44 (clip detection missing a late font swap) is addressed in b42bc1f.

bindClip now re-measures when document.fonts.ready settles and whenever a clip cell changes size (ResizeObserver), in addition to window resize. It also re-measures after clicks and typing, because a row entering edit mode swaps the cell text for an input without changing the cell size; that had left a stale tab stop on the cell being edited.

Checked in headless Chromium with the font files held back until after first paint, and with a row entering edit mode. In the held-font run the same cells were cut off before and after the swap, so that run confirms the re-measure executes without errors but does not show a state change.

@codex review

Copy link
Copy Markdown
Owner Author

fred review: b42bc1fc8e76becbd83c9899fec66b035a1e5e1d

The late-font clipping issue is addressed: clip measurement now runs after fonts settle, with resize observation and rechecks after click and input. No additional actionable findings in the static review. Codex review is pending. No local execution.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: b42bc1fc8e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

SonarCloud failed the gate on b42bc1f: the fonts line tested a Promise
for truthiness and left it without a rejection handler (two bug-level
findings, reliability rating C).

- Check document.fonts, not the promise, and end the chain with .catch.
- Clear the smaller findings in the same code: hoist the helpers that
  capture nothing (sortValue, isClipToggle), replace nested ternaries
  with compareExact, sortArrow and nextSortDir, use Number.parseFloat,
  Number.isNaN and Array.find, and write the test's ordering check as
  a >= b.

No behaviour change.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@AlteredParadox

Copy link
Copy Markdown
Owner Author

claude: 652c479 fixes the SonarCloud gate failure on b42bc1f. The fonts line tested a Promise for truthiness and had no rejection handler (two bug-level findings); it now checks document.fonts and ends the chain with .catch. The same commit clears the smaller Sonar findings in the sort and clip code by hoisting helpers and removing nested ternaries. No behaviour change; the sort, clip and late-font browser checks were re-run and still pass.

@codex review

Copy link
Copy Markdown
Owner Author

fred review: 652c479223544d6ff68ff535dd3a66b776eacf38

No additional actionable findings in the static review. The fonts readiness promise now has a rejection handler without testing the promise itself for truthiness. Helper extraction preserves the numeric and mixed-family key ordering, sort direction and empty-last behavior. The prior accessibility fixes remain in place. Current-head Codex code review pending. No local execution.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: 652c479223

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@sonarqubecloud

Copy link
Copy Markdown

@AlteredParadox
AlteredParadox merged commit 0de8a9d into main Nov 19, 2026
9 checks passed
@AlteredParadox
AlteredParadox deleted the table-refresh branch November 19, 2026 02:04
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