-
Notifications
You must be signed in to change notification settings - Fork 25
feat: space readme loading indicator #408
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
b1f69c1 to
c621cfc
Compare
There was a problem hiding this 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 loading indicator for space readme content to improve the user experience while the readme is being fetched. Key changes include adding new reactive state and utility functions in the spaces store to track readme loading, and updating the Spaces header component to display a spinner with a retry mechanism for loading readme content.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/web-pkg/src/composables/piniaStores/spaces.ts | Added reactive state and helper functions (add, remove, purge) for tracking readme loading |
| packages/web-app-files/src/components/Spaces/SpaceHeader.vue | Updated to display a spinner when readme is loading and integrated readme loading management |
|
|
||
| const addToReadmesLoading = (id: string) => { | ||
| if (!unref(readmesLoading).includes(id)) { | ||
| unref(readmesLoading).push(id) |
Copilot
AI
Mar 24, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider replacing 'unref(readmesLoading).push(id)' with 'readmesLoading.value.push(id)' to ensure state updates are tracked consistently by Vue's reactivity system.
| unref(readmesLoading).push(id) | |
| readmesLoading.value.push(id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fine since we're pushing into the array, not modifying the variable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have/had a rule though to use .value when writing and unref when reading. I'd also prefer readmesLoading.value.push(id), but just for DX/cosmetic reasons. 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've always used unref when modifying an array 🙈 Will keep it in mind for the future.
c621cfc to
24accf2
Compare
24accf2 to
74e7818
Compare
kulmann
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! 🥇
Similar to #398 but for the space readme.
fixes #361