Skip to content

fix(desktop): spinner for v2 changes loading + delayed file/change tree tooltips - #5410

Merged
Kitenite merged 4 commits into
mainfrom
loading-changes-spinner
Jul 2, 2026
Merged

Kitenite merged 4 commits into
mainfrom
loading-changes-spinner

Conversation

@Kitenite

@Kitenite Kitenite commented Jul 1, 2026 •

Copy link
Copy Markdown
Member

Summary

Small polish to the v2 workspace sidebar:

  • Spinner for "Loading changes…" — the changes tab loading state showed plain text while the files tab showed a spinner. It now renders the shared Spinner (@superset/ui/spinner), sized to match the files loading spinner.
  • Delayed tooltips on file/change tree rows — row hint tooltips popped instantly. They now wait 500ms:
    • Changes tree (FileRow): delayDuration={500} on the row <Tooltip>.
    • File tree (ShadowClickHint): this hint is a forced-open tooltip, so delayDuration doesn't apply — added a hover timer (default 500ms) before the hint anchors, cleared on row-change/leave/unmount.

Test Plan

  • Open a v2 workspace, Changes tab — a spinner shows next to "Loading changes…", matching the Files tab.
  • Hover a row in the changes tree — the hint tooltip appears after a short delay, not instantly.
  • Hover a row in the file tree — same delayed behavior.
  • Move between rows quickly — no premature/flickering tooltips.

Summary by CodeRabbit

  • New Features
    • Added a clearer loading state for changes, with a centered spinner and loading message.
    • Introduced a short hover delay before tooltips appear, reducing accidental popups.
  • Bug Fixes
    • Improved tooltip behavior so it only appears when hovering remains on the same item, and closes cleanly when the pointer leaves.

@coderabbitai

coderabbitai Bot commented Jul 1, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c7687fc0-f112-48a9-b7d0-a862c74868fa

📥 Commits

Reviewing files that changed from the base of the PR and between d583ed6 and 860993a.

📒 Files selected for processing (3)
  • apps/desktop/src/renderer/lib/clickPolicy/components/ShadowClickHint/ShadowClickHint.tsx
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/components/WorkspaceSidebar/hooks/useChangesTab/components/ChangesFileList/components/FileRow/FileRow.tsx
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/components/WorkspaceSidebar/hooks/useChangesTab/components/ChangesTabContent/ChangesTabContent.tsx

📝 Walkthrough

Walkthrough

Adds a configurable delay (default 500ms) before ShadowClickHint's hover tooltip appears, using a timer that re-validates the hovered row and clears on leave/unmount. FileRow's tooltip now sets delayDuration={500}. ChangesTabContent's loading state now renders a Spinner alongside the loading text.

Changes

Sidebar interaction and loading updates

Layer / File(s) Summary
ShadowClickHint delayed hover
apps/desktop/.../ShadowClickHint/ShadowClickHint.tsx
Adds delayMs prop (default 500ms via DEFAULT_HINT_DELAY_MS), a timer ref, and clearTimer helper; handleMouseOver defers setting the hover rect and re-checks the hovered row before applying it, handleMouseLeave clears the timer, and a useEffect clears timers on unmount/update.
FileRow tooltip delay
apps/desktop/.../FileRow/FileRow.tsx
Sets delayDuration={500} on the Tooltip wrapping the hover-displayed discard control.
ChangesTabContent loading spinner
apps/desktop/.../ChangesTabContent/ChangesTabContent.tsx
Imports Spinner from @superset/ui/spinner and renders it alongside the "Loading changes..." text in the loading state.

Estimated code review effort: 2 (Simple) | ~10 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Pointer
  participant ShadowClickHint
  participant TimerRef

  Pointer->>ShadowClickHint: handleMouseOver(row)
  ShadowClickHint->>TimerRef: clearTimer()
  ShadowClickHint->>TimerRef: setTimeout(delayMs)
  TimerRef-->>ShadowClickHint: timeout fires
  ShadowClickHint->>ShadowClickHint: check hovered row still matches
  ShadowClickHint->>ShadowClickHint: setHoverRect(anchor)
  Pointer->>ShadowClickHint: handleMouseLeave()
  ShadowClickHint->>TimerRef: clearTimer()
Loading

Possibly related PRs

  • superset-sh/superset#4442: Adds the folder/tree view that reuses the same FileRow/ShadowClickHint hover and click row mechanisms modified in this PR.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: adding a spinner to the v2 Changes sidebar loading state.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed The PR description includes a clear summary and test plan, matching the key template sections despite missing some optional sections.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch loading-changes-spinner

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@ghost

ghost commented Jul 1, 2026 •

Copy link
Copy Markdown

Ready to review this PR? Stage has broken it down into 3 individual chapters for you:

Title
1 Add loading spinner to changes sidebar
2 Implement delayed tooltips in ShadowClickHint
3 Apply tooltip delay to file rows
Open in Stage

Chapters generated by Stage for commit 860993a on Jul 2, 2026 3:52pm UTC.

@greptile-apps

greptile-apps Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds a Loader2 spinner from lucide-react to the loading state of the Changes tab in the v2 workspace sidebar, making it visually consistent with the Files tab which already shows a spinner.

  • The change adds gap-2 to the flex container, imports Loader2, renders it with size-3.5 animate-spin, and wraps the text in a <span> — exactly mirroring the Files tab pattern.

Confidence Score: 5/5

A minimal, self-contained UI tweak — safe to merge.

The change touches one file, adds a single well-established icon component with no side effects, and brings the Changes tab loading state into alignment with the Files tab. No logic is altered.

No files require special attention.

Important Files Changed

Filename Overview
apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/components/WorkspaceSidebar/hooks/useChangesTab/components/ChangesTabContent/ChangesTabContent.tsx Adds a Loader2 spinner from lucide-react to the loading state, matching the visual pattern used in the Files tab. Gap-2 added to the flex container and the text wrapped in a span for correct layout.

Sequence Diagram

%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
    participant User
    participant ChangesTab
    participant GitStatus as git.getStatus (tRPC)

    User->>ChangesTab: Open v2 workspace Changes tab
    ChangesTab->>GitStatus: Fetch git status
    Note over ChangesTab: status.isLoading = true
    ChangesTab-->>User: Render Loader2 spinner + "Loading changes..."
    GitStatus-->>ChangesTab: Return status data
    Note over ChangesTab: status.isLoading = false
    ChangesTab-->>User: Render ChangesHeader + Toolbar + FileList
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
    participant User
    participant ChangesTab
    participant GitStatus as git.getStatus (tRPC)

    User->>ChangesTab: Open v2 workspace Changes tab
    ChangesTab->>GitStatus: Fetch git status
    Note over ChangesTab: status.isLoading = true
    ChangesTab-->>User: Render Loader2 spinner + "Loading changes..."
    GitStatus-->>ChangesTab: Return status data
    Note over ChangesTab: status.isLoading = false
    ChangesTab-->>User: Render ChangesHeader + Toolbar + FileList
Loading

Reviews (1): Last reviewed commit: "fix(desktop): show spinner in v2 changes..." | Re-trigger Greptile

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 1 file

Re-trigger cubic

@Kitenite Kitenite changed the title fix(desktop): show spinner in v2 changes sidebar loading state fix(desktop): spinner for v2 changes loading + delayed file/change tree tooltips Jul 2, 2026
@Kitenite
Kitenite merged commit a9acdd2 into main Jul 2, 2026
8 of 10 checks passed
@Kitenite
Kitenite deleted the loading-changes-spinner branch July 2, 2026 15:53
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

🧹 Preview Cleanup Complete

The following preview resources have been cleaned up:

  • ✅ Neon database branch

Thank you for your contribution! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant