Skip to content

Conversation

@jpggvilaca
Copy link
Contributor

@jpggvilaca jpggvilaca commented Nov 5, 2025

📝 Description

  • Add new UI for tabs with action menu
  • Replace previous tabs on workspaces/users/datasets
  • Tests coming on the next PR
  • If you have any other suggestions for the name let me know :D
Screenshot 2025-11-05 at 11 29 14 Screenshot 2025-11-05 at 11 29 16 Screenshot 2025-11-05 at 11 29 22 Screenshot 2025-11-05 at 11 29 26 Screenshot 2025-11-05 at 11 29 31

✨ Type of Change

Select the type of change your PR introduces:

  • 🐞 Bug fix – Non-breaking change which fixes an issue
  • 🚀 New feature – Non-breaking change which adds functionality
  • 🔨 Refactor – Non-breaking change which refactors the code base
  • 💥 Breaking change – Changes that break existing functionality
  • 📚 Documentation update
  • 🔒 Security update
  • 🧪 Tests

🧪 Testing Scenarios

Describe how the changes were tested and how reviewers can test them too:

  • ✅ Tested manually
  • 🤖 Run automated end-to-end tests

✅ Checklist

Before submitting the PR, ensure the following:

  • 🔍 PR title is clear and meaningful
  • ✍️ PR description clearly explains the changes and their reason
  • 📝 I have linked the PR to the corresponding GitHub Issues, if any
  • 💬 I have commented my code, especially in hard-to-understand areas
  • 📄 I have made corresponding changes to the documentation
  • ✅ I have added tests that prove my fix is effective or my feature works

Copilot AI review requested due to automatic review settings November 5, 2025 10:26
@jpggvilaca jpggvilaca added the UI label Nov 5, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces a new reusable ManagedTabs component to standardize tab interfaces across the application, replacing previous implementations in workspaces, users, and datasets pages. The new component provides consistent tab layout, overflow handling, and action button integration.

Key changes:

  • Created a new ManagedTabs component with overflow management and action button support
  • Refactored workspace and dataset tab implementations to use the new component
  • Consolidated tab styling from multiple files into the new component

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
managed-tabs.module.scss New stylesheet defining tab layout, selection indicators, and overflow behavior for the reusable tabs component
managed-tabs.component.tsx New component implementing reusable tab functionality with configurable overflow, action buttons, and custom rendering
custom-tab-item.module.scss Removed duplicated tab styling that's now centralized in managed-tabs
workspace-users-toolbar.component.tsx Refactored to use ManagedTabs instead of custom Tabs implementation
project-dataset.component.tsx Replaced custom tab list with ManagedTabs, integrating overflow and export functionality
dataset-tab-list.component.tsx Removed file as functionality is now provided by ManagedTabs
workspaces-tabs.component.tsx Refactored to use ManagedTabs, extracting WorkspaceItem as separate component
landing-page.module.scss Removed unused styles now handled by ManagedTabs

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@MarkRedeman MarkRedeman left a comment

Choose a reason for hiding this comment

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

As a general feedback, I think it would be nicer if we could have a component interface that looked more like Spectrum's tabs but with decorated behaviour, something like this,

<Tabs aria-label="History of Ancient Rome">
  <ManagedTabList>
    <ManagedTabItem key="FoR">Founding of Rome</ManagedTabItem>
    <ManagedTabItem key="MaR">Monarchy and Republic</ManagedTabItem>
    <ManagedTabItem key="Emp">Empire</ManagedTabItem>
  </ManagedTabList>
  <TabPanels>
    <Item key="FoR">
      Arma virumque cano, Troiae qui primus ab oris.
    </Item>
    <Item key="MaR">
      Senatus Populusque Romanus.
    </Item>
    <Item key="Emp">
      Alea jacta est.
    </Item>
  </TabPanels>
</Tabs>

A good example of this is also the customizing layout from the spectrum docs where they show you can add extra behaviour on the tabs by extending it, not modifying (e.g. open closed principle applies here)

I'd prefer rendering the TabPanels and their contents to be the responsibility of the consumer of this component, as otherwise you might end up with needing to update ManagedTabs every time we have a design that slightly differs from its current behaviour.

import { useWorkspacesTabs } from './hooks/use-pinned-collapsed-workspace.hook';

import classes from '../../../shared/components/custom-tab-item/custom-tab-item.module.scss';
const WorkspaceItem = ({ workspace }: { workspace: WorkspaceEntity }) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor: I'd rename this to WorkspaceTabItem, just to emphasize it will render a tab item.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated

Comment on lines 79 to 86
addButton={
FEATURE_FLAG_WORKSPACE_ACTIONS
? {
id: 'create-new-workspace-id',
ariaLabel: 'Create new workspace',
tooltipText: 'Create a new workspace',
onPress: createWorkspaceDialogState.open,
isLoading: createWorkspace.isPending,
}
: undefined
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Could this be a send as a ReactNode, instead of giving ManagedTabs knowledge about an "add button". Perhaps we could provide this as a suffix prop?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated, still calling it addButton though. Because i guess we always want to add an item, with suffix i think it's unclear of what we're "suffixing"

Comment on lines 70 to 78
renderTabPanel={() => (
<HasPermission
operations={[OPERATION.CAN_SEE_WORKSPACE]}
specialCondition={!FEATURE_FLAG_WORKSPACE_ACTIONS || undefined}
Fallback={<NoPermissionPlaceholder />}
>
<Workspace />
</HasPermission>
)}
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we rename this to children, so that you'd do:
<ManagedTabs ...><Workspace /></ManagedTabs/>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@jpggvilaca jpggvilaca force-pushed the jvilaca/add-reusable-tabs branch from c29354e to 8607e4e Compare November 6, 2025 08:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants