Skip to content

Refactor workspace routing, controllers, and styling#88

Merged
RussellLuo merged 7 commits into
OpenCSGs:mainfrom
jialudev:chore/web-router
May 20, 2026
Merged

Refactor workspace routing, controllers, and styling#88
RussellLuo merged 7 commits into
OpenCSGs:mainfrom
jialudev:chore/web-router

Conversation

@jialudev
Copy link
Copy Markdown
Collaborator

@jialudev jialudev commented May 20, 2026

Summary

This PR contains four workspace web updates:

  1. Make workspace navigation router-first.

    • Derive the active workspace pane and sidebar tab from the current React Router location instead of duplicating that state in Zustand.
    • Route pane selections through pathForPane and React Router navigation so deep links, aliases, and browser back/forward behavior stay consistent.
    • Add focused navigation tests and document the router-first maintenance rules in the web architecture and development docs.
  2. Split the workspace controller into focused hooks.

    • Keep useWorkspaceController as the composition layer for WorkspacePage.
    • Move conversation, agent, upgrade, profile preview, Hub, and shell behavior into dedicated controller hooks with shared TypeScript contracts.
    • Add stronger types for workspace query setters, navigation inputs, controller props, and agent-like data used by the workspace UI.
  3. Reorganize workspace styling and theme tokens.

    • Move large workspace styles out of global CSS and into the relevant workspace, sidebar, modal, conversation, agent, and Hub component stylesheets.
    • Refresh light/dark theme tokens, typography, borders, shadows, focus states, and Hub workspace variables for more consistent theming.
    • Keep message content and workspace component styling aligned with the updated token set.
  4. Remove legacy static frontend assets.

    • Delete the old web/static comparison assets now that the Vite app is the maintained frontend.
    • Update workspace and web documentation to describe the current web/app to web/static-dist build flow.

Testing

  • Not run by Codex, per request. The branch was already tested locally.

jialudev added 5 commits May 20, 2026 15:58
- Replaced existing color tokens with a new palette for light and dark themes.
- Introduced new variables for gray and brand colors to enhance UI consistency.
- Updated font families for better typography across the application.
- Adjusted shadow and border styles for improved visual hierarchy.
- Ensured accessibility by refining color contrasts and focus indicators.
- Implemented `useWorkspaceHubController` to manage hub templates and errors.
- Created `useWorkspaceShellController` for handling workspace shell state and interactions.
- Refactored `useWorkspaceNavigation` to remove unnecessary state management for channel tools and member list.
- Updated tests to reflect changes in navigation hook usage.
- Adjusted legacy contract test to ensure correct hub template creation behavior.
- Added a new types file to define various types used across workspace hooks.
- Updated `useAgentController`, `useConversationController`, `useProfilePreviewController`, and other hooks to utilize the new types for better type safety.
- Enhanced `useWorkspaceNavigation` and `useWorkspaceShellController` to improve navigation handling and workspace shell management.
- Refactored several functions to include type annotations for parameters and return types, improving code clarity and maintainability.
- Introduced new properties in the `AgentLike` type to support additional agent attributes.
@jialudev jialudev requested a review from RussellLuo May 20, 2026 09:32
@RussellLuo RussellLuo merged commit 8a6c91a into OpenCSGs:main May 20, 2026
@jialudev jialudev deleted the chore/web-router branch May 21, 2026 09:32
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