Skip to content

Restore the Active toggle and keep it visible on disabled rows - #803

Merged
heisbrot merged 1 commit into
mainfrom
feature/disabled-rows-active-toggle
Sep 14, 2026
Merged

heisbrot merged 1 commit into
mainfrom
feature/disabled-rows-active-toggle

Conversation

@SunsetDrifter

@SunsetDrifter SunsetDrifter commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Issue ticket number and link

Resolves NET-1647

Summary

Disabled routing peers, network resources, policies and legacy routes were only distinguishable by a faded row, which made them easy to miss when reviewing a network. The fade also dimmed the controls needed to re-enable them.

  • Bring back the Active toggle column in the routing peers, resources, policies and legacy routes tables. It was hidden in Improve Table Filters Layout #654.
  • Add a cellClassName hook to DataTable and a shared fadeDisabledRowCells helper. On a disabled row every cell fades except the toggle and the actions menu, which stay fully visible.
  • Give the legacy routes action column an explicit actions id so the helper can recognise it.
  • Ignore row clicks that land in the toggle or actions cells of the policies table, so aiming for the switch no longer opens the edit modal.

Documentation

Select exactly one:

  • I added/updated documentation for this change
  • Documentation is not needed for this change (explain why)

Visual-only change to existing tables. It restores a toggle column that previously existed and adjusts how disabled rows are dimmed. No new behaviour, settings or API surface to document.

Summary by CodeRabbit

  • New Features
    • Added visible Active indicators to access control, resources, routing peers, and routes tables.
    • Disabled rows are visually faded while their enable/disable and actions controls remain fully visible.
    • Selecting interactive controls no longer triggers the surrounding row action.
  • Improvements
    • Table cells can now receive context-aware styling, enabling more precise presentation of disabled-row states.

Disabled routing peers, network resources, policies and legacy routes were
only distinguishable by a faded row, and the fade also dimmed the controls
needed to re-enable them. Bring back the Active toggle column that was
hidden in #654, and add a cellClassName hook to DataTable with a shared
fadeDisabledRowCells helper that fades every cell of a disabled row except
the toggle and actions cells.
@linear-code

linear-code Bot commented Sep 14, 2026

Copy link
Copy Markdown

NET-1647

@coderabbitai

coderabbitai Bot commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: fe50b49e-544e-42af-9ca2-c75bb65d2243

📥 Commits

Reviewing files that changed from the base of the PR and between de04558 and 217eb6d.

📒 Files selected for processing (7)
  • src/components/table/DataTable.tsx
  • src/components/table/disabledRowCells.test.ts
  • src/components/table/disabledRowCells.ts
  • src/modules/access-control/table/AccessControlTable.tsx
  • src/modules/networks/resources/ResourcesTable.tsx
  • src/modules/networks/routing-peers/NetworkRoutingPeersTable.tsx
  • src/modules/routes/RouteTable.tsx

Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review.


📝 Walkthrough

Walkthrough

The change adds per-cell class support to DataTable, introduces shared disabled-row cell helpers, and updates four tables to show Active controls. Disabled rows fade non-interactive cells while toggle and action cells remain visible.

Changes

Table cell behavior

Layer / File(s) Summary
Per-cell class contract and disabled-cell rules
src/components/table/DataTable.tsx, src/components/table/disabledRowCells.ts, src/components/table/disabledRowCells.test.ts
DataTable accepts cellClassName. Shared helpers identify interactive columns and apply opacity-50 to non-interactive cells in disabled rows. Tests cover enabled and disabled rows.

Access control integration

Layer / File(s) Summary
Access control active column and click handling
src/modules/access-control/table/AccessControlTable.tsx
The table shows an Active column, uses per-cell disabled-row styling, and skips row-click handling for interactive cells.

Network and route integration

Layer / File(s) Summary
Network and route active columns
src/modules/networks/resources/ResourcesTable.tsx, src/modules/networks/routing-peers/NetworkRoutingPeersTable.tsx, src/modules/routes/RouteTable.tsx
The tables show Active cells and use shared per-cell disabled-row styling. The route actions column now has an explicit actions ID.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Sequence Diagram(s)

sequenceDiagram
  participant TableView
  participant DataTable
  participant DisabledRowHelpers
  participant ActiveCell
  TableView->>DataTable: Pass cellClassName and Active cell renderer
  DataTable->>DisabledRowHelpers: Evaluate each cell
  DisabledRowHelpers-->>DataTable: Return opacity-50 or empty class
  DataTable->>ActiveCell: Render enabled state
  ActiveCell-->>DataTable: Display Active control
Loading

Suggested reviewers: heisbrot

Merge Risk: ⚪ Minimal · up to 217eb

The restored Active controls and disabled-row action visibility are consistently wired across the updated tables. The change is ready to merge.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 7 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly summarizes the main change: restoring the Active toggle and keeping it visible on disabled rows.
Description check ✅ Passed The description includes the issue link, a detailed summary, the required documentation selection with an explanation, and no missing required sections. The optional E2E section does not require chang…
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/disabled-rows-active-toggle

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

A rabbit sees the cells align
Active toggles now shine
Disabled rows softly fade
Actions stay ready, unafraid
The table hops with clearer light

Comment @coderabbitai help to get the list of available commands.

@heisbrot
heisbrot merged commit f4e80d3 into main Sep 14, 2026
8 of 12 checks passed
@heisbrot
heisbrot deleted the feature/disabled-rows-active-toggle branch September 14, 2026 13:43
SunsetDrifter added a commit that referenced this pull request Sep 17, 2026
…hows (#805)

* fix: keep tables from scrolling horizontally when the Active toggle shows

The Active toggle column restored in #803 adds about 100px to every table,
which pushed policies and legacy routes into a horizontal scrollbar next to
an expanded sidebar on 1280px and 1440px screens.

Hide the column below the xl breakpoint (2xl for legacy routes, the widest
table) instead of dropping it. Enable/Disable remains available in each
row's action menu on narrower viewports.

Also on the legacy routes page: tighten cell padding in the expanded route
rows, remove a 10px max-width on the network address that made it overflow
into the Type column, let the Name cell shrink from 270px to 200px when
space is tight, and drop the unused sort control from the Active header.

* refactor: hide the Active column with responsive classes instead of a media query hook

Columns can now carry a className through TanStack's column meta, which
DataTable applies to both the header and body cells. The Active column
uses `hidden xl:table-cell` (`2xl` for legacy routes) so the browser
handles the breakpoint and no JavaScript listener is needed.

* refactor: apply the Active column treatment consistently and cover it with a test

- Peer routes, group resources and reverse proxy targets carry the same
  Active toggle column and now hide it below xl like the other tables.
- DataTable gains tableHeadClassName so RouteTable can tighten header and
  body padding through props instead of descendant selectors.
- The four tables reference ENABLED_COLUMN_ID instead of a literal id so
  the fade-on-disable helper and the column definitions stay linked.
- The network address cell truncates past 16rem with a title tooltip so a
  long IPv6 CIDR cannot push the routes table back into a scrollbar.
- Add a DataTable render test for column meta classes on header and body.
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