Skip to content

chore: refactor the surfaces routes to reflect the new functionality#4078

Open
arikorn wants to merge 2 commits intobitfocus:mainfrom
arikorn:chore_refactor_surfaces_routes
Open

chore: refactor the surfaces routes to reflect the new functionality#4078
arikorn wants to merge 2 commits intobitfocus:mainfrom
arikorn:chore_refactor_surfaces_routes

Conversation

@arikorn
Copy link
Copy Markdown
Contributor

@arikorn arikorn commented Apr 7, 2026

The main Surfaces page is now more than the "configured surfaces" table, so "configured surfaces" is not really the correct name for it..

This refactor also supports the new features in PR #4062, so that the surfaces group-toggle shows active when the remote page is selected. (It will probably create a minor merge-conflict with it, due to the Sidebar.tsx overlap. Also note: both PRs delete the redundant "configured surfaces" sidebar item.)

Bonus: apply some (local) rabbit suggestions to make code a bit more robust.

  • MainSurfacesPage: inform the user if rescan USB crashes (i.e. .catch)
  • MainSurfacesPage: render the Alert only if there's a message (rather than using CSS to hide it)
  • better redirect handling in remote/$connectionId.tsx (similar to earlier commits for surfaces and integrations)
  • fix a typo here or there

The second commit here improves wording and help on the Surfaces page. (Makes it more like the "Connections" and other pages.)

Summary by CodeRabbit

  • Navigation & Routing

    • Reorganized surfaces navigation structure: updated URL paths for streamlined navigation flow.
    • Added automatic redirects for legacy navigation paths to maintain continuity.
  • UI Updates

    • Removed duplicate menu item from sidebar.
    • Updated surfaces table column headers for clarity.
    • Enhanced visual styling on surfaces grid headers.

arikorn added 2 commits April 6, 2026 21:41
The main page is more than the "configured surfaces" table, so "configured surfaces" is not really the correct name for it..

Perhaps more importantly, this refactor also supports the new features in PR# 4062, so that the surfaces group-toggle shows active when the remote page is selected.  (It will probably create a minor merge-conflict with it, due to the Sidebar.tsx overlap. Also note: both PRs delete the redundant "configured surfaces" sidebar item.)
(Makes it more like the "Connections" and other pages.)
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 7, 2026

📝 Walkthrough

Walkthrough

The PR restructures the surfaces routing architecture by moving routes from the /surfaces/configured/ path to /surfaces/, renaming the main page component, adding backwards compatibility redirects, updating navigation targets across multiple components, and renaming remote surfaces routes to use an underscore prefix.

Changes

Cohort / File(s) Summary
Sidebar & Settings Navigation
webui/src/Layout/Sidebar.tsx, webui/src/UserConfig/index.tsx
Removed "Configured" sidebar menu item and updated settings navigation paths from /surfaces/configured/integrations to /surfaces/integrations.
Surface Panels & Display Components
webui/src/Surfaces/EditPanel.tsx, webui/src/Surfaces/SurfaceSettingsPanel.tsx, webui/src/Surfaces/KnownSurfacesTable.tsx
Updated panel close/navigation routes to /surfaces and refreshed table column headers from "NO"/"Info" to "Nr."/"Configured Surfaces and Groups".
Surface Instance Management
webui/src/Surfaces/Instances/AddSurfaceInstancePanel.tsx, webui/src/Surfaces/Instances/SurfaceInstanceEdit/SurfaceInstanceEditPanel.tsx, webui/src/Surfaces/Instances/SurfaceInstanceList/SurfaceInstanceList.tsx
Updated all navigation targets from /surfaces/configured/integrations/* to /surfaces/integrations/* paths.
Main Surfaces Page
webui/src/Surfaces/MainSurfacesPage.tsx
Renamed component from ConfiguredSurfacesPage to MainSurfacesPage, generalized routes from /surfaces/configured/... to /surfaces/..., enhanced help content, and improved error handling for USB refresh operations.
Route Definitions
webui/src/routeTree.gen.ts, webui/src/routes/_app/surfaces.tsx, webui/src/routes/_app/surfaces/$itemId.tsx, webui/src/routes/_app/surfaces/configured.tsx, webui/src/routes/_app/surfaces/configured.$.tsx, webui/src/routes/_app/surfaces/index.tsx, webui/src/routes/_app/surfaces/integrations/*.tsx, webui/src/routes/_app/surfaces_/remote.tsx, webui/src/routes/_app/surfaces_/remote/*.tsx
Restructured routing: added new /surfaces base route group, moved integrations from /surfaces/configured/integrations to /surfaces/integrations, changed /surfaces/remote to /surfaces_/remote, and added backwards compatibility redirects (301 HTTP status) from old /surfaces/configured paths to /surfaces.
Styling
webui/src/scss/_surfaces.scss
Applied italic font style to grid header cells in the surfaces container.

Poem

🛤️ Routes take flight from "/configured" walls,
Simplified paths echo through the halls,
The surfaces gleam at /surfaces/ true,
Old paths redirect with a 301 view—
Backwards in style, yet forward we go! ✨

🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically summarizes the main change: refactoring surfaces routes to reflect updated functionality beyond just configured surfaces.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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

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

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
webui/src/routes/_app/surfaces_/remote/$connectionId.tsx (1)

1-7: Declarative navigation is a nice improvement!

Switching from the imperative navigate() call to the <Navigate> component is cleaner and more React-idiomatic. The route structure with surfaces_ correctly maps to /surfaces/remote as confirmed by the parent route file.

One small observation: the import on line 4 ('~/Resources/Error') doesn't include the .js extension, while the similar file $itemId.tsx uses '~/Resources/Error.js'. It would be nice to keep these consistent across the codebase when you have a moment, but it's certainly not blocking!


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 1a5e1899-117d-4b50-ad01-1f52320bf1c7

📥 Commits

Reviewing files that changed from the base of the PR and between fa85ca6 and a13071a.

📒 Files selected for processing (24)
  • webui/src/Layout/Sidebar.tsx
  • webui/src/Surfaces/EditPanel.tsx
  • webui/src/Surfaces/Instances/AddSurfaceInstancePanel.tsx
  • webui/src/Surfaces/Instances/SurfaceInstanceEdit/SurfaceInstanceEditPanel.tsx
  • webui/src/Surfaces/Instances/SurfaceInstanceList/SurfaceInstanceList.tsx
  • webui/src/Surfaces/KnownSurfacesTable.tsx
  • webui/src/Surfaces/MainSurfacesPage.tsx
  • webui/src/Surfaces/SurfaceSettingsPanel.tsx
  • webui/src/UserConfig/index.tsx
  • webui/src/routeTree.gen.ts
  • webui/src/routes/_app/surfaces.tsx
  • webui/src/routes/_app/surfaces/$.tsx
  • webui/src/routes/_app/surfaces/$itemId.tsx
  • webui/src/routes/_app/surfaces/configured.$.tsx
  • webui/src/routes/_app/surfaces/configured.tsx
  • webui/src/routes/_app/surfaces/index.tsx
  • webui/src/routes/_app/surfaces/integrations/$instanceId.tsx
  • webui/src/routes/_app/surfaces/integrations/add.tsx
  • webui/src/routes/_app/surfaces/integrations/index.tsx
  • webui/src/routes/_app/surfaces_/remote.tsx
  • webui/src/routes/_app/surfaces_/remote/$connectionId.tsx
  • webui/src/routes/_app/surfaces_/remote/discover.tsx
  • webui/src/routes/_app/surfaces_/remote/index.tsx
  • webui/src/scss/_surfaces.scss
💤 Files with no reviewable changes (1)
  • webui/src/routes/_app/surfaces/$.tsx

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