feat(UI): add loading logic#1095
Merged
benjamin-747 merged 1 commit intoJun 4, 2025
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds a loading spinner to the table components to improve user experience while data is being fetched.
- Introduces conditional spinner display in the tree detail page.
- Refactors the CodeView to use a new SpinnerTable component with loading state.
- Updates the Table component to incorporate a loading spinner wrapper.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| moon/apps/web/pages/[org]/code/tree/[...path]/index.tsx | Adds spinner display logic based on TreeCommitInfo. |
| moon/apps/web/components/CodeView/index.tsx | Replaces direct CodeTable usage with SpinnerTable for loading state encapsulation. |
| moon/apps/web/components/CodeView/TableWithLoading/index.tsx | Implements the new SpinnerTable component to manage spinner logic and table display. |
| moon/apps/web/components/CodeView/Table/index.tsx | Integrates a Spinner wrapper and adjusts key generation for table cells. |
| moon/apps/web/components/CodeView/CodeTable.tsx | Passes down the loading prop to RTable for consistent spinner behavior. |
Comments suppressed due to low confidence (2)
moon/apps/web/components/CodeView/CodeTable.tsx:96
- [nitpick] The loading prop is passed down to RTable even though the parent conditionally displays a spinner; ensure that this dual approach to loading states is intentional and does not lead to duplicate spinner displays.
<RTable columns={columns ?? []} datasource={directory} size='3' align='center' onClick={handleRowClick} loading={loading} />
moon/apps/web/components/CodeView/Table/index.tsx:46
- [nitpick] Concatenating c.key and d.oid for key generation may lead to potential ambiguity if d.oid is not guaranteed unique; consider validating the uniqueness of d.oid or using a more explicit unique identifier.
key={c.key + d.oid}
benjamin-747
approved these changes
Jun 4, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
增加:
table加载动画