Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
776fb8d
design
JonnyTran Aug 9, 2025
07d335e
1. Create workspace storage infrastructure
JonnyTran Aug 9, 2025
2f96b9d
2. Enhance workspace use case and repository integration
JonnyTran Aug 9, 2025
c18cb9b
2. Enhance workspace use case and repository integration
JonnyTran Aug 9, 2025
f2ce75b
lint
JonnyTran Aug 9, 2025
434433a
updated @typescript-eslint/typescript-estree
JonnyTran Aug 9, 2025
7f04978
Merge branch 'feat/workspace-pinia-store' of github.com:Extralit/extr…
JonnyTran Aug 9, 2025
92cb42c
updated WorkspaceBreadcrumbDropdown requirement
JonnyTran Aug 9, 2025
97a98cd
3. Create workspace breadcrumb dropdown component
JonnyTran Aug 9, 2025
542084a
4.2: Update breadcrumb item structure
JonnyTran Aug 9, 2025
8885e90
5. Update breadcrumb generation in view models
JonnyTran Aug 9, 2025
e98a337
6. Update home page breadcrumbs and workspace integration
JonnyTran Aug 9, 2025
6f054f0
7. Implement workspace URL parameter integration
JonnyTran Aug 9, 2025
82d9eb9
Refactor workspace URL parameters in header and user settings components
JonnyTran Aug 9, 2025
905f48b
fix styling
JonnyTran Aug 9, 2025
5390f04
7.1 Add workspace URL parameter handling
JonnyTran Aug 9, 2025
bbbc9a6
Implement workspace URL parameter handling and create dataset breadcr…
JonnyTran Aug 9, 2025
ebcd30e
Enhance breadcrumb dropdown components with specific search placehold…
JonnyTran Aug 9, 2025
4620f83
rename Workspaces pinia store
JonnyTran Aug 9, 2025
e639636
fixtests
JonnyTran Aug 9, 2025
7a03db9
fix codecov
JonnyTran Aug 9, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
415 changes: 415 additions & 0 deletions .kiro/specs/global-workspace-selector/design.md

Large diffs are not rendered by default.

121 changes: 121 additions & 0 deletions .kiro/specs/global-workspace-selector/requirements.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
# Requirements Document

## Introduction

The Global Workspace Selector feature transforms workspace selection from a local dataset filter into a centralized, persistent workspace management system integrated into the application header. This feature moves workspace selection from the dataset list filters to the breadcrumb area, creating a unified workspace context that persists across all pages and components.

The feature implements a Pinia store-based workspace management system with local storage persistence, ensuring users maintain their workspace context as they navigate through different sections of the application. The workspace selector will be integrated into the BaseBreadcrumbs component within the AppHeader, providing immediate access to workspace switching from any page.

## Requirements

### Requirement 1

**User Story:** As a researcher, I want to select a workspace from the application header that persists across all pages, so that I can maintain consistent workspace context throughout my session.

#### Acceptance Criteria

1. WHEN I visit any page in the application THEN the system SHALL display a workspace selector in the application header breadcrumb area
2. WHEN I select a workspace from the header selector THEN the system SHALL persist this selection in local storage
3. WHEN I navigate between pages THEN the system SHALL maintain my selected workspace context
4. WHEN I refresh the page THEN the system SHALL restore my previously selected workspace from local storage
5. WHEN no workspace is selected and workspaces are available THEN the system SHALL automatically select the first available workspace
6. WHEN I change the selected workspace THEN the system SHALL immediately update all workspace-dependent components on the current page
7. WHEN workspaces are loading THEN the system SHALL display a loading indicator in the workspace selector

### Requirement 2

**User Story:** As a developer, I want workspace state managed through a centralized Pinia store with reactive updates, so that all components can access and respond to workspace changes consistently.

#### Acceptance Criteria

1. WHEN the application initializes THEN the system SHALL create a WorkspaceStorage Pinia store following the existing storage pattern
2. WHEN workspace data is fetched THEN the system SHALL store it in the centralized workspace store
3. WHEN the selected workspace changes THEN the system SHALL emit reactive updates to all subscribed components
4. WHEN components need workspace data THEN the system SHALL provide access through the useWorkspaces composable
5. WHEN workspace data is updated THEN the system SHALL automatically revalidate dependent data (datasets, documents, etc.)
6. WHEN the workspace store is accessed THEN the system SHALL provide both current workspace list and selected workspace state
7. WHEN workspace selection changes THEN the system SHALL trigger cache invalidation for workspace-dependent API calls

### Requirement 3

**User Story:** As a researcher, I want the workspace selector integrated into the breadcrumb navigation, so that I can access workspace switching without disrupting my current workflow.

#### Acceptance Criteria

1. WHEN I view the application header THEN the system SHALL display the workspace selector as part of the breadcrumb navigation
2. WHEN I click on the workspace selector THEN the system SHALL open a dropdown showing all available workspaces
3. WHEN viewing the workspace dropdown THEN the system SHALL display workspace names with dataset counts
4. WHEN I select a different workspace THEN the system SHALL update the breadcrumb display to show the new workspace name
5. WHEN the workspace selector is active THEN the system SHALL provide visual feedback (highlighting, active states)
6. WHEN I search within the workspace dropdown THEN the system SHALL filter workspaces by name
7. WHEN no workspaces are available THEN the system SHALL display an appropriate message in the breadcrumb area

### Requirement 4

**User Story:** As a researcher, I want dataset and document lists to automatically filter based on my selected workspace, so that I only see content relevant to my current workspace context.

#### Acceptance Criteria

1. WHEN I select a workspace THEN the system SHALL automatically filter the dataset list to show only datasets from that workspace
2. WHEN I select a workspace THEN the system SHALL automatically filter the document list to show only documents from that workspace
3. WHEN the workspace selection changes THEN the system SHALL update filtered content without requiring page refresh
4. WHEN no workspace is selected THEN the system SHALL display all datasets and documents across workspaces
5. WHEN workspace filtering is applied THEN the system SHALL update URL parameters to reflect the current workspace context
6. WHEN I bookmark a URL with workspace context THEN the system SHALL restore that workspace selection when accessing the bookmark
7. WHEN workspace-dependent API calls are made THEN the system SHALL automatically include the selected workspace ID in requests

### Requirement 5

**User Story:** As a researcher, I want the workspace selector to reuse existing workspace selection components, so that I have a consistent user experience across the application.

#### Acceptance Criteria

1. WHEN implementing the header workspace selector THEN the system SHALL reuse the existing WorkspacesFilter and WorkspaceSelector components
2. WHEN the workspace selector is displayed THEN the system SHALL maintain the same visual design and interaction patterns as the existing workspace filters
3. WHEN workspace data is formatted THEN the system SHALL use the same formatting logic that includes dataset counts per workspace
4. WHEN workspace selection occurs THEN the system SHALL emit the same events and data structures as existing workspace components
5. WHEN the workspace selector is integrated THEN the system SHALL remove the workspace filter from the DatasetList component to avoid duplication
6. WHEN workspace components are reused THEN the system SHALL ensure they work correctly in both header and modal contexts
7. WHEN workspace selection UI is displayed THEN the system SHALL adapt appropriately for the header layout constraints

### Requirement 6

**User Story:** As a researcher, I want workspace persistence to work seamlessly with existing local storage patterns, so that my workspace preferences are maintained consistently.

#### Acceptance Criteria

1. WHEN workspace selection is persisted THEN the system SHALL use the existing useLocalStorage service pattern
2. WHEN I select a workspace THEN the system SHALL store the workspace ID in local storage with an appropriate key
3. WHEN the application loads THEN the system SHALL retrieve the stored workspace ID and restore the workspace selection
4. WHEN stored workspace ID is invalid or workspace no longer exists THEN the system SHALL gracefully fallback to the first available workspace
5. WHEN workspace data changes THEN the system SHALL validate the stored workspace selection and update if necessary
6. WHEN local storage is unavailable THEN the system SHALL continue to function with session-only workspace selection
7. WHEN workspace persistence fails THEN the system SHALL log appropriate errors and continue with default workspace selection

### Requirement 7

**User Story:** As a developer, I want proper service interfaces and dependency injection for workspace management, so that the system is maintainable and testable.

#### Acceptance Criteria

1. WHEN implementing workspace storage THEN the system SHALL create an IWorkspaceStorage interface following existing patterns
2. WHEN workspace services are needed THEN the system SHALL provide proper dependency injection through the existing DI container
3. WHEN workspace use cases are implemented THEN the system SHALL follow the existing use case pattern with proper error handling
4. WHEN workspace repository is used THEN the system SHALL integrate with the existing WorkspaceRepository without modifications
5. WHEN workspace state management is implemented THEN the system SHALL provide proper TypeScript types for all workspace-related data
6. WHEN workspace components are tested THEN the system SHALL support proper mocking and testing patterns
7. WHEN workspace services are registered THEN the system SHALL integrate with the existing service registration patterns

### Requirement 8

**User Story:** As a researcher, I want the workspace selector to handle edge cases gracefully, so that I have a reliable experience even when workspace data is unavailable or changes.

#### Acceptance Criteria

1. WHEN workspace API calls fail THEN the system SHALL display appropriate error messages and provide retry options
2. WHEN I lose access to a previously selected workspace THEN the system SHALL automatically switch to an available workspace
3. WHEN all workspaces are removed THEN the system SHALL display an appropriate message and disable workspace-dependent features
4. WHEN workspace data is being fetched THEN the system SHALL show loading states without blocking other functionality
5. WHEN workspace selection conflicts occur THEN the system SHALL resolve them by prioritizing the most recent valid selection
6. WHEN network connectivity is lost THEN the system SHALL continue to function with cached workspace data
7. WHEN workspace permissions change THEN the system SHALL update the available workspace list and handle selection changes appropriately
Loading
Loading