Skip to content

Conversation

@JammingBen
Copy link
Contributor

Similar to #398 but for the space readme.

fixes #361

@JammingBen JammingBen self-assigned this Mar 24, 2025
Copilot AI review requested due to automatic review settings March 24, 2025 13:48
@JammingBen JammingBen force-pushed the feat/space-readme-loading-indicator branch from b1f69c1 to c621cfc Compare March 24, 2025 13:49
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 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)
Copy link

Copilot AI Mar 24, 2025

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.

Suggested change
unref(readmesLoading).push(id)
readmesLoading.value.push(id)

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

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.

Copy link
Contributor

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. 😅

Copy link
Contributor Author

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.

@JammingBen JammingBen force-pushed the feat/space-readme-loading-indicator branch from c621cfc to 24accf2 Compare March 24, 2025 13:58
@JammingBen JammingBen force-pushed the feat/space-readme-loading-indicator branch from 24accf2 to 74e7818 Compare March 24, 2025 14:29
@JammingBen JammingBen requested a review from kulmann March 24, 2025 14:30
Copy link
Contributor

@kulmann kulmann left a comment

Choose a reason for hiding this comment

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

Thank you! 🥇

@JammingBen JammingBen merged commit 8a3819a into main Mar 25, 2025
8 checks passed
@JammingBen JammingBen deleted the feat/space-readme-loading-indicator branch March 25, 2025 06:25
This was referenced Mar 25, 2025
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.

Loading Spinner when updating Space icon or description

3 participants