Conversation
|
Note: In order to make this work, we need to run pnpm build, as the assets needs to be bundled (image will be requested from the server url). Which also means, to have it work without pnpm build, it requires a new docker image |
There was a problem hiding this comment.
PR Overview
This PR fixes how space icons are loaded by incorporating a default space icon when none is provided and adjusting asset management in the build configuration.
- Updates useLoadPreview to fetch and cache a default space icon.
- Extends vite.config.ts to copy image assets.
- Introduces a reactive defaultSpaceImageBlobURL and minor UI tweaks in Projects.vue for disabled previews.
Reviewed Changes
| File | Description |
|---|---|
| packages/web-pkg/src/composables/resources/useLoadPreview.ts | Loads and caches a default space icon when space image data is missing |
| vite.config.ts | Adds 'images' directory to static asset copy configuration |
| packages/web-pkg/src/composables/piniaStores/spaces.ts | Adds defaultSpaceImageBlobURL state and its setter for space icon management |
| packages/web-app-files/src/views/spaces/Projects.vue | Adds UI classes for table previews reflecting disabled state |
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (2)
packages/web-pkg/src/composables/resources/useLoadPreview.ts:107
- Ensure that the blob URL retrieved from httpAuthenticated.get is used immediately rather than relying on the ref update from setdefaultSpaceImageBlobURL; this can prevent potential race conditions when reading unref(defaultSpaceImageBlobURL). Consider assigning the created URL to a variable and use it directly for resource.thumbnail and the return value.
resource.thumbnail = unref(defaultSpaceImageBlobURL)
packages/web-pkg/src/composables/piniaStores/spaces.ts:114
- Consider renaming 'setdefaultSpaceImageBlobURL' to 'setDefaultSpaceImageBlobURL' for improved readability and consistency with naming conventions.
const setdefaultSpaceImageBlobURL = (blobURL: string) => {
4c44f4c to
906cfbc
Compare
89e05e4 to
1b64698
Compare
kulmann
left a comment
There was a problem hiding this comment.
Uh nice, thank you! This looks great and consistent now in the different states. 💪
Description
successor of #248
Related Issue
How Has This Been Tested?
Types of changes