feat: set view mode e.G tiles or table view globally, add condensed view to Spaces view #1306
feat: set view mode e.G tiles or table view globally, add condensed view to Spaces view #1306
Conversation
There was a problem hiding this comment.
Pull Request Overview
Globalizes folder view mode selection across routes and introduces a condensed table view for project spaces.
- Standardizes view mode query key usage (removes per-route prefix) to make selection global.
- Adds condensed table view extension to project spaces.
- Updates Projects view and related composables to consume the new global view mode.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/web-pkg/src/components/ViewOptions.vue | Removes route-scoped query key for view mode persistence. |
| packages/web-app-files/tests/unit/views/spaces/Projects.spec.ts | Adjusts test mocking for view mode (introduces duplicate mock). |
| packages/web-app-files/src/views/spaces/Projects.vue | Switches to globally provided viewMode and passes it to the folder view component. |
| packages/web-app-files/src/composables/resourcesViewDefaults/useResourcesViewDefaults.ts | Uses unscoped global query key for view mode. |
| packages/web-app-files/src/composables/extensions/useFolderViews.ts | Exposes condensed table view to project spaces extension point. |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| @@ -171,6 +171,7 @@ function getMountedWrapper({ | |||
| }) | |||
|
|
|||
| vi.mocked(queryItemAsString).mockImplementation(() => includeDisabled.toString()) | |||
There was a problem hiding this comment.
The second mockImplementation call immediately overrides the first, making the includeDisabled.toString() return path untestable. If you intended different sequential return values, use mockImplementationOnce twice or mockReturnValueOnce chain; if not, remove the first line.
| vi.mocked(queryItemAsString).mockImplementation(() => includeDisabled.toString()) |
| }) | ||
|
|
||
| vi.mocked(queryItemAsString).mockImplementation(() => includeDisabled.toString()) | ||
| vi.mocked(queryItemAsString).mockImplementation(() => 'resource-table') |
There was a problem hiding this comment.
[nitpick] The literal 'resource-table' should use the corresponding constant/enumeration (e.g. FolderViewModeConstants.name.table or similar) to prevent drift if the identifier changes. This keeps tests aligned with production definitions.
Description
Related Issue
How Has This Been Tested?
Types of changes