Repository navigation
luci-app-tailscale-community: add sticky header and peer search filter - #9083
Tokisaki-Galaxy wants to merge 1 commit into
Conversation
openwrt-ai
left a comment
There was a problem hiding this comment.
Commit checks
- 441b2a2 "luci-app-tailscale-community: add sticky header and peer search filter": the body doesn't mention the changed
callGetStatus()fallback defaults ingetRunningStatus()andload()({ status: 'stopped', peers: {} }). Add a bullet for it, or split it into its own commit.
Generated by Claude Code
| const table = E('table', { 'class': 'cbi-table' }, [ | ||
| E('tr', { 'class': 'cbi-table-header' }, peerTableHeaders.map(header => { | ||
| let th_style = 'padding-right: 20px; text-align: left;'; | ||
| let th_style = 'padding-right: 20px; text-align: left; position: sticky; top: 0; background: inherit; z-index: 1;'; |
There was a problem hiding this comment.
background: inherit takes the <tr>'s background, which is transparent in most themes, so scrolled rows show through the sticky header. The header cell needs an opaque, theme-aware background (e.g. set by a theme class or CSS variable) rather than inherit.
Generated by Claude Code
BKPepe
left a comment
There was a problem hiding this comment.
The overall idea makes sense, but I don't think the current implementation is ready yet.
The main issue is that the filter input is still recreated on every 10-second poll via devicesView.replaceChildren(renderDevices(res)). Re-applying its value and focus afterwards does not preserve the DOM/input state and can still interrupt IME composition, text selection, and caret handling. Please render the filter input once and only update the peer rows when polling.
The sticky header also uses background: inherit, which can leave the header transparent and cause scrolled rows to show through. Please use an opaque, theme-aware background instead.
There are a few smaller issues as well: the hard-coded #ddd border is not theme-aware, peerid is unused, and the new POT entry should be regenerated rather than appended manually.
Also, the change to the callGetStatus() fallback from { running: false } to { status: 'stopped', peers: {} } is unrelated to the UI feature and should either be explained in the commit body or split into a separate commit.
441b2a2 to
fef354a
Compare
|
Hi @BKPepe Thank you for the detailed and constructive review. I have refactored the implementation to address all points:
|
fef354a to
b7b2264
Compare
|
|
||
| const thead = E('thead', {}, [ | ||
| E('tr', { 'class': 'cbi-table-header cbi-section-table-titles', 'style': 'position: sticky; top: 0; z-index: 1;' }, peerTableHeaders.map(header => { | ||
| let th_style = 'padding-right: 20px; text-align: left; background-color: var(--background-color, #fff);'; |
There was a problem hiding this comment.
No in-tree theme defines --background-color, so the #fff fallback always applies, and the header stays white in bootstrap's dark mode. Bootstrap exposes [`--background-color-high` at cascade.css:27](https://github.com/openwrt/luci/blob/b7b2264279ba26ac9fdf11b825bf34e001a008e9/themes/luci-theme-bootstrap/htdocs/luci-static/bootstrap/cascade.css#L27``) instead.
| let th_style = 'padding-right: 20px; text-align: left; background-color: var(--background-color, #fff);'; | |
| let th_style = 'padding-right: 20px; text-align: left; background-color: var(--background-color-high, #fff);'; |
Generated by Claude Code
…iner - Add search input to filter peer devices by hostname, IP, or OS - Mount filter input once and only update table body on poll - Avoid recreating input element to prevent IME composition interruption - Wrap devices table in a scrollable container with sticky header - Use theme-aware sticky header styling and remove hardcoded border Signed-off-by: tokisaki galaxy <moebest@outlook.jp>
b7b2264 to
b2f005a
Compare
openwrt-ai
left a comment
There was a problem hiding this comment.
Commit checks
- b2f005a "luci-app-tailscale-community: add peer search filter and scroll container" — "remove hardcoded border" and "Avoid recreating input element" describe changes between review rounds; master had no border and no filter input. Describe the change against master only.
Generated by Claude Code
Description
When many devices are connected to the Tailnet, browsing and managing the device list can be cumbersome. This PR introduces two UI enhancements to improve the device list experience:
Sticky Header and Scrollable Container:
480px.position: sticky; top: 0; z-index: 1) during vertical scrolling.Peer Search Filter:
.
Tested on
Checklist
Signed-off-by: tokisaki galaxy <moebest@outlook.jp>row matching the author name and email.<package name>: titlefirst line subject (under 80 characters).