Skip to content

refactor(ui): improve flow onboarding with first workspace creation and re-design settings ui #299

Merged
l1ttps merged 11 commits intomainfrom
refactor-onboarding
Mar 7, 2026
Merged

refactor(ui): improve flow onboarding with first workspace creation and re-design settings ui #299
l1ttps merged 11 commits intomainfrom
refactor-onboarding

Conversation

@l1ttps
Copy link
Copy Markdown
Member

@l1ttps l1ttps commented Mar 7, 2026

No description provided.

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly refactors the application's user interface and core workflows, focusing on improving the onboarding experience for new users and streamlining the settings management. By separating layout concerns, redesigning the settings pages with a grouped navigation, and introducing a mandatory workspace creation step, the changes aim to provide a more intuitive, organized, and efficient user journey. Additionally, API responses for workspaces now include more comprehensive data, supporting the enhanced UI.

Highlights

  • UI Layout Refactor: The core application layout has been refactored, separating the main AppBar into a simpler content wrapper and introducing a new HeaderBar component to manage the sticky header, search, notifications, and user menu. This allows for more flexible header configurations, especially for pages without a full sidebar.
  • Settings UI Redesign: The entire settings interface has been redesigned for improved user experience and organization. A new SettingsLayout provides grouped navigation, and individual settings components have been refactored into distinct cards, enhancing clarity and modularity. This includes new dedicated pages for API Keys, Preferences, Security, and Workspace-specific settings.
  • Workspace Onboarding and Management Flow: The workspace creation and management flow has been enhanced. A new RequireWorkspace component ensures users create a workspace before accessing protected routes, streamlining the onboarding process. The workspace creation form is now a dedicated full-page experience, and a new /workspaces page allows users to view and manage all their workspaces.
  • Dynamic Routing and Layouts: The application's routing system has been updated to support dynamic layouts. The ProtectedRoute now accepts a layout prop, enabling different UI structures (e.g., application layout vs. settings layout) based on the route. Most protected routes now also enforce the RequireWorkspace check.
  • API Enhancements for Workspaces: The backend API for fetching workspaces has been updated to include targetCount and memberCount directly in the workspace response. This provides richer data for workspace overviews without requiring additional API calls, improving performance for workspace listings.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • console/src/components/common/layout/app-bar.tsx
    • Removed header-related UI elements and logic.
    • Simplified component to act as a basic content wrapper.
  • console/src/components/common/layout/header-bar.tsx
    • Added new component to encapsulate sticky header logic.
    • Implemented conditional rendering for sidebar trigger, app logo, search form, assistant chat, and notification bell based on workspace presence.
  • console/src/components/common/layout/protect-layout.tsx
    • Updated to use the new HeaderBar component.
    • Conditionally rendered AppSidebar based on whether a workspace exists.
    • Changed children prop type from JSX.Element to ReactNode.
  • console/src/components/common/layout/settings-layout.tsx
    • Added new layout component for settings pages.
    • Implemented grouped navigation for settings tabs with mobile sheet and desktop sidebar views.
    • Included 'Back To App' button for easy navigation.
  • console/src/components/common/require-workspace.tsx
    • Added new component to enforce workspace existence for routes.
    • Redirected users to the workspace creation page if no workspace is found.
  • console/src/components/ui/dropdown-menu.tsx
    • Updated class strings for various dropdown menu components.
    • Added hover:cursor-pointer to DropdownMenuItem.
  • console/src/components/ui/nav-user.tsx
    • Added isOnlyAvatar prop to control display of user name and email.
    • Implemented dynamic dropdownSide prop for the dropdown menu.
  • console/src/components/ui/workspace-switcher.tsx
    • Removed direct CreateWorkspace dialog integration.
    • Added navigation options to 'All workspaces' and 'Create workspace' pages.
  • console/src/pages/settings/components/account-settings.tsx
    • Removed component, its functionality was split and integrated into new settings components.
  • console/src/pages/settings/components/api-keys-settings.tsx
    • Added new component to display and manage workspace API keys.
    • Implemented copy and rotate API key functionality.
  • console/src/pages/settings/components/brand-name-and-logo.tsx
    • Renamed from system-config.tsx.
    • Removed CardTitle from the component's direct render, now handled by the layout.
  • console/src/pages/settings/components/change-password.tsx
    • Wrapped the form in a Card component with a title.
    • Updated form field labels and button text for consistency.
    • Adjusted button placement to the right.
  • console/src/pages/settings/components/configs.tsx
    • Updated to directly render WorkspaceConfigs.
  • console/src/pages/settings/components/list-workspaces.tsx
    • Removed component, its functionality was replaced by the new /workspaces page.
  • console/src/pages/settings/components/preferences.tsx
    • Added new component to group user profile and theme settings.
  • console/src/pages/settings/components/security-settings.tsx
    • Added new component to group security-related settings, specifically password change.
  • console/src/pages/settings/components/system-config.tsx
    • Renamed to brand-name-and-logo.tsx.
    • Refactored component to focus on brand name and logo settings.
  • console/src/pages/settings/components/theme-switcher.tsx
    • Wrapped the theme switcher in a Card component with an 'Appearance' title.
  • console/src/pages/settings/components/update-user.tsx
    • Wrapped the user update form in a Card component with a 'Profile' title.
    • Updated button text from 'Update' to 'Save'.
  • console/src/pages/settings/components/workspace-configs.tsx
    • Removed specific width styling from the Card component.
  • console/src/pages/settings/components/workspace-settings.tsx
    • Added new component for managing individual workspace details.
    • Implemented forms for updating workspace name and description.
    • Included a 'Danger Zone' section with workspace deletion functionality.
  • console/src/pages/settings/settings.tsx
    • Refactored settings page to use settingsTabGroups for structured navigation.
    • Removed Page component wrapper and Tabs UI, now handled by SettingsLayout.
    • Updated to use new dedicated settings components (e.g., WorkspaceSettings, ApiKeysSettings).
  • console/src/pages/workspaces/create-workspace-dialog.tsx
    • Removed component, its functionality was moved to the full-page create-workspace.tsx.
  • console/src/pages/workspaces/create-workspace.tsx
    • Redesigned the workspace creation page from a dialog to a full-page form.
    • Integrated Card components for better presentation.
    • Added navigation to the home page upon successful workspace creation.
  • console/src/pages/workspaces/index.tsx
    • Added new page to list and manage all user workspaces.
    • Implemented card-based display for each workspace, showing member and target counts.
    • Provided navigation to create new workspaces and select existing ones.
  • console/src/routers/NotFound.tsx
    • Redesigned the 404 page with a Card layout.
    • Updated styling and added a home button with an icon.
  • console/src/routers/ProtectedRoute.tsx
    • Introduced a layout prop to dynamically switch between ProtectedLayout and SettingsLayout.
    • Removed conditional rendering for /studio path.
  • console/src/routers/index.tsx
    • Updated routing to use the new RequireWorkspace component for most protected routes.
    • Configured settings routes to use ProtectedRoute with the settings layout.
    • Added new routes for /workspaces and /workspaces/create.
  • console/src/services/apis/gen/queries.ts
    • Updated GetManyWorkspaceDto to GetManyWorkspaceResponseDtoDto.
    • Introduced WorkspaceResponseDto type, including targetCount and memberCount.
  • core-api/src/modules/workspaces/dto/workspaces.dto.ts
    • Added WorkspaceResponseDto with targetCount and memberCount properties.
    • Updated API property descriptions for clarity.
  • core-api/src/modules/workspaces/workspaces.controller.ts
    • Updated getWorkspaces endpoint to return GetManyResponseDto(WorkspaceResponseDto).
    • Adjusted descriptions for various workspace API endpoints.
  • core-api/src/modules/workspaces/workspaces.service.ts
    • Modified getWorkspaces method to use raw SQL queries to fetch targetCount and memberCount.
    • Removed notification creation logic upon workspace creation.
  • worker/services/core-api/api.ts
    • Updated GetManyWorkspaceDto to GetManyWorkspaceResponseDtoDto.
    • Introduced WorkspaceResponseDto interface, including targetCount and memberCount.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a significant and well-executed refactoring of the UI, focusing on the user onboarding flow by forcing workspace creation, and redesigning the settings pages. The introduction of RequireWorkspace to protect routes, the new dedicated page for workspace creation, and the modularization of the settings UI into a new SettingsLayout with smaller components are all excellent changes that improve code structure and user experience. I've found a few issues to address: a layout problem in the header for users without a workspace, an invalid HTML structure in the new settings navigation menu, and a potential memory leak from an uncleaned setTimeout. I've provided suggestions to address these points. Overall, this is a great contribution that enhances the application's usability and maintainability.

Note: Security Review did not run due to the size of the PR.

Comment on lines +24 to +51
{settingsTabGroups.map((group, groupIndex) => (
<div>
<li key={group.name} className="p-2">
{/* Group header */}
<div className="text-xs font-semibold text-muted-foreground uppercase mb-2 tracking-wider px-3">
{group.name}
</div>
{/* Tabs in this group */}
{group.tabs.map((tab) => (
<Link
key={tab.id}
to={tab.path}
className={`block px-3 py-1 rounded-md text-sm font-medium transition-colors mb-1 last:mb-0 ${
isActive(tab.path)
? 'bg-accent text-accent-foreground'
: 'text-muted-foreground hover:bg-accent hover:text-accent-foreground'
}`}
>
{tab.label}
</Link>
))}
</li>
{/* Group divider - shown after group */}
{groupIndex < settingsTabGroups.length - 1 && (
<div className="border-b my-2" />
)}
</div>
))}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

The list of setting groups has two issues:

  1. The root <div> element inside the map at line 25 is missing a key prop.
  2. The structure <ul> > <div> > <li> is invalid HTML. A <li> element must be a direct child of a <ul>. The same applies to the divider div at line 48.

This can lead to unexpected rendering behavior and accessibility issues. Refactoring to use React.Fragment and ensuring <li> elements are direct children of <ul> will fix this.

        {settingsTabGroups.map((group, groupIndex) => (
          <React.Fragment key={group.name}>
            <li className="p-2">
              {/* Group header */}
              <div className="text-xs font-semibold text-muted-foreground uppercase mb-2 tracking-wider px-3">
                {group.name}
              </div>
              {/* Tabs in this group */}
              {group.tabs.map((tab) => (
                <Link
                  key={tab.id}
                  to={tab.path}
                  className={`block px-3 py-1 rounded-md text-sm font-medium transition-colors mb-1 last:mb-0 ${
                    isActive(tab.path)
                      ? 'bg-accent text-accent-foreground'
                      : 'text-muted-foreground hover:bg-accent hover:text-accent-foreground'
                  }`}
                >
                  {tab.label}
                </Link>
              ))}
            </li>
            {/* Group divider - shown after group */}
            {groupIndex < settingsTabGroups.length - 1 && (
              <li className="px-3">
                <div className="border-b my-2" />
              </li>
            )}
          </React.Fragment>
        ))}

Comment on lines +35 to +40
<div className="flex justify-end w-full">
<AppLogo type="small" />
<div className="ml-auto">
<NavUser isOnlyAvatar dropdownSide="bottom" />
</div>
</div>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The layout for the header when no workspace exists seems incorrect. The combination of justify-end on the parent div and ml-auto on a child div is confusing and will likely result in both the logo and the user avatar being pushed to the right side of the header. For a more standard and consistent layout with the logo on the left and user navigation on the right, you could simplify the structure to be consistent with the other branch of this conditional rendering.

        <div className="flex w-full items-center justify-between">
          <AppLogo type="small" />
          <NavUser isOnlyAvatar dropdownSide="bottom" />
        </div>

await navigator.clipboard.writeText(apiKeyData.apiKey);
setCopied(true);
toast.success('API key copied to clipboard');
setTimeout(() => setCopied(false), 2000);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Using setTimeout without cleanup can lead to memory leaks if the component unmounts before the timeout completes. It's safer to use a useEffect hook to manage the timer's lifecycle. This will ensure the timer is cleared if the component unmounts or if copied state changes again before the timeout finishes.

Here's how you could refactor it:

// At the top level of your component, after state declarations
useEffect(() => {
  if (copied) {
    const timer = setTimeout(() => {
      setCopied(false);
    }, 2000);

    return () => clearTimeout(timer);
  }
}, [copied]);

// And in handleCopy, you would just set the state:
const handleCopy = async () => {
  if (apiKeyData?.apiKey) {
    await navigator.clipboard.writeText(apiKeyData.apiKey);
    setCopied(true);
    toast.success('API key copied to clipboard');
  }
};

@l1ttps l1ttps merged commit 31c12fc into main Mar 7, 2026
10 checks passed
l1ttps added a commit that referenced this pull request Mar 7, 2026
…nd re-design settings ui (#299)

* feat(console): add all workspaces navigation and improve 404 page UI

* refactor(layout): extract header into dedicated HeaderBar component

* refactor(console): add workspace-aware header layout

* refactor(console): convert workspace creation to page and add route protection

* refactor(console): update workspaces UI from table to card layout

* feat(workspaces): add member and target counts to workspace list

* refactor(settings): reorganize settings page with sidebar layout

* feat(settings): add API keys management

* refactor(settings): improve API key display layout

* fix(screenshot-cell): add type assertion for screenshotPath

* refactor(workspaces): use workspace selector hook
l1ttps added a commit that referenced this pull request Mar 16, 2026
* feat(console, admin): add list users for administration

* feat(console): redesign user detail sheet

* fix(console): fix sorting for server datatable

* refactor(console): restyle user-detail-sheet

* feat(console): add confirm dialog for action ban

* feat(console): add user detail section

* fix(console): fix small typo in tls tab (#290)

* feat(asset): add tls filter for asset

* fix(core): fix asset test

* fix(asset): fix based on bot reviews

* fix(console): fix small typo in tls tab

* fix(console): add missing tls for queryParams in asset context

* fix(console): fix tls query hook in dashboard

---------

Co-authored-by: Quang Vinh <32523515+l1ttps@users.noreply.github.com>

* chore(deps): bump multer from 2.0.2 to 2.1.0 (#292)

Bumps [multer](https://github.com/expressjs/multer) from 2.0.2 to 2.1.0.
- [Release notes](https://github.com/expressjs/multer/releases)
- [Changelog](https://github.com/expressjs/multer/blob/main/CHANGELOG.md)
- [Commits](expressjs/multer@v2.0.2...v2.1.0)

---
updated-dependencies:
- dependency-name: multer
  dependency-version: 2.1.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* feat(targets): create multiple targets (#291)

* refactor(targets): combine logic create target in transaction

* feat(targets): add bulk target creation endpoint

* feat(targets): add bulk creation support

* fix(console): move tabList into component to avoid out of context (#293)

Co-authored-by: Quang Vinh <32523515+l1ttps@users.noreply.github.com>

* fix(assets): select asset relations in query (#297)

* refactor(ui): improve flow onboarding with first workspace creation and re-design settings ui  (#299)

* feat(console): add all workspaces navigation and improve 404 page UI

* refactor(layout): extract header into dedicated HeaderBar component

* refactor(console): add workspace-aware header layout

* refactor(console): convert workspace creation to page and add route protection

* refactor(console): update workspaces UI from table to card layout

* feat(workspaces): add member and target counts to workspace list

* refactor(settings): reorganize settings page with sidebar layout

* feat(settings): add API keys management

* refactor(settings): improve API key display layout

* fix(screenshot-cell): add type assertion for screenshotPath

* refactor(workspaces): use workspace selector hook

* feat(auth): add session retry with exponential backoff

* chore(agent): migrate ai agent

* feat(router): add admin users route

* feat(console): implement create user

* feat(console): add change name, email and reset password in user detail

* fix(console): fix duplicate tlsHosts in context

* fix(console): use loading state of data table and improve client user type

* fix(console): add admin route

* feat(console): Implement role-based access control for settings tabs and sidebar menu items based on user roles.

* style(console): update 'Add User' button to outline variant

* refactor(console): move add user button to table toolbar

* fix(console): add autoComplete to user detail input

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Quang Vinh <32523515+l1ttps@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: l1ttps <l1ttps443@gmail.com>
@l1ttps l1ttps deleted the refactor-onboarding branch March 22, 2026 03:23
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