Skip to content

feat: add pulse indicator when has unsaved changes#87

Open
joaovictorjs wants to merge 2 commits intowebadderall:mainfrom
joaovictorjs:feat/show-unsaved-changes-indicator
Open

feat: add pulse indicator when has unsaved changes#87
joaovictorjs wants to merge 2 commits intowebadderall:mainfrom
joaovictorjs:feat/show-unsaved-changes-indicator

Conversation

@joaovictorjs
Copy link
Contributor

@joaovictorjs joaovictorjs commented Mar 21, 2026

This PR adds a visual indicator to the "Save" button to inform the user that there are pending changes to be saved.

Preview

Demo

Summary by CodeRabbit

  • New Features
    • Save button now shows a small, pulsing sky‑blue dot when there are unsaved changes, making it easier to notice and resume editing.

@coderabbitai
Copy link

coderabbitai bot commented Mar 21, 2026

Warning

.coderabbit.yaml has a parsing error

The CodeRabbit configuration file in this repository has a parsing error and default settings were used instead. Please fix the error(s) in the configuration file. You can initialize chat with CodeRabbit to get help with the configuration file.

💥 Parsing errors (1)
Validation error: Invalid regex pattern for base branch. Received: "*" at "reviews.auto_review.base_branches[0]"
⚙️ Configuration instructions
  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
📝 Walkthrough

Walkthrough

Added a conditional sky‑blue “pinging” dot to the Save button that appears when hasUnsavedChanges is true; adjusted JSX indentation for the Export dropdown trigger without changing behavior.

Changes

Cohort / File(s) Summary
UI Visual Indicator
src/components/video-editor/VideoEditor.tsx
Added conditional pinging sky‑blue dot inside Save button shown when hasUnsavedChanges === true; minor JSX indentation adjustment for Export dropdown trigger Button (no behavior change).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A tiny blue ping in sight,

Hops to warn of changes light,
Tap save quick, keep work in tune,
Moonlit edits, hummed by June.

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive The description is minimal but covers the core purpose. However, it lacks several required template sections including Motivation, Type of Change, Testing Guide, and Checklist. Enhance the description by adding missing sections from the template: explain the motivation/problem solved, specify the type of change, provide testing steps, and complete the checklist items.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding a visual pulse indicator to the Save button that appears when there are unsaved changes.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
src/components/video-editor/VideoEditor.tsx (1)

2380-2383: Add accessibility support for the unsaved changes indicator.

The visual indicator is effective but screen reader users won't be informed of unsaved changes. Consider adding an accessible label to the button or a screen-reader-only text element.

Also, lines 2381-2382 have inconsistent leading whitespace (extra space before the tab character).

♻️ Suggested improvement with accessibility and whitespace fix
 					<Button
 						type="button"
 						onClick={handleSaveProject}
 						className="inline-flex h-8 min-w-[96px] items-center justify-center gap-1.5 rounded-[5px] bg-white px-4 text-black transition-colors hover:bg-white/92"
+						aria-label={hasUnsavedChanges ? t("common.actions.save") + " - " + t("common.status.unsavedChanges", "unsaved changes") : t("common.actions.save")}
 					>
 						<span className={`${hasUnsavedChanges ? "flex" : "hidden"} size-2 relative`}>
- 							<span className="absolute inline-flex h-full w-full animate-ping rounded-full bg-sky-400 opacity-75"></span>
-  							<span className="relative inline-flex size-2 rounded-full bg-sky-500"></span>
+							<span className="absolute inline-flex h-full w-full animate-ping rounded-full bg-sky-400 opacity-75"></span>
+							<span className="relative inline-flex size-2 rounded-full bg-sky-500"></span>
 						</span>
 						<Save className="h-4 w-4" />
 						<span className="text-sm font-semibold tracking-tight">{t("common.actions.save")}</span>
 					</Button>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/video-editor/VideoEditor.tsx` around lines 2380 - 2383, The
unsaved-changes indicator in VideoEditor.tsx uses only visual cues (the span
controlled by hasUnsavedChanges) and lacks accessibility for screen readers;
update the markup around the indicator (the span that toggles with
hasUnsavedChanges) to include an accessible label — either add
aria-hidden="true" to the decorative ping spans and add a sibling
screen-reader-only element (e.g., visually-hidden text with role="status" or
aria-live="polite") that reads "Unsaved changes" when hasUnsavedChanges is true,
or set an appropriate aria-label/aria-live on the container so assistive tech is
informed; also remove the extra leading whitespace on the two inner span lines
to fix the formatting inconsistency.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@src/components/video-editor/VideoEditor.tsx`:
- Around line 2380-2383: The unsaved-changes indicator in VideoEditor.tsx uses
only visual cues (the span controlled by hasUnsavedChanges) and lacks
accessibility for screen readers; update the markup around the indicator (the
span that toggles with hasUnsavedChanges) to include an accessible label —
either add aria-hidden="true" to the decorative ping spans and add a sibling
screen-reader-only element (e.g., visually-hidden text with role="status" or
aria-live="polite") that reads "Unsaved changes" when hasUnsavedChanges is true,
or set an appropriate aria-label/aria-live on the container so assistive tech is
informed; also remove the extra leading whitespace on the two inner span lines
to fix the formatting inconsistency.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 0d728225-e196-4600-a624-4ab9b23d5ee9

📥 Commits

Reviewing files that changed from the base of the PR and between 6e177db and c87cfed.

📒 Files selected for processing (1)
  • src/components/video-editor/VideoEditor.tsx

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
src/components/video-editor/VideoEditor.tsx (1)

2380-2383: Nice implementation of the unsaved changes indicator.

The pulsing dot provides clear visual feedback to users about pending changes. The use of animate-ping with an absolute-positioned overlay creates a clean pulse effect.

Minor nit: Lines 2381-2382 have an extra leading space character before the <span> tags, causing inconsistent indentation.

✨ Fix indentation
 						<span className={`${hasUnsavedChanges ? "flex" : "hidden"} size-2 relative`}>
- 							<span className="absolute inline-flex h-full w-full animate-ping rounded-full bg-[`#2563EB`] opacity-75"></span>
-  							<span className="relative inline-flex size-2 rounded-full bg-[`#2563EB`]"></span>
+							<span className="absolute inline-flex h-full w-full animate-ping rounded-full bg-[`#2563EB`] opacity-75"></span>
+							<span className="relative inline-flex size-2 rounded-full bg-[`#2563EB`]"></span>
 						</span>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/video-editor/VideoEditor.tsx` around lines 2380 - 2383, Remove
the extra leading space characters before the two inner <span> elements in the
unsaved changes indicator block so their indentation matches the parent <span>
and surrounding JSX; locate the snippet that uses the hasUnsavedChanges
conditional and the inner spans with classes "absolute inline-flex h-full w-full
animate-ping rounded-full bg-[`#2563EB`] opacity-75" and "relative inline-flex
size-2 rounded-full bg-[`#2563EB`]" and adjust whitespace so both inner <span>
tags start at the same indentation level as the parent for consistent
formatting.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@src/components/video-editor/VideoEditor.tsx`:
- Around line 2380-2383: Remove the extra leading space characters before the
two inner <span> elements in the unsaved changes indicator block so their
indentation matches the parent <span> and surrounding JSX; locate the snippet
that uses the hasUnsavedChanges conditional and the inner spans with classes
"absolute inline-flex h-full w-full animate-ping rounded-full bg-[`#2563EB`]
opacity-75" and "relative inline-flex size-2 rounded-full bg-[`#2563EB`]" and
adjust whitespace so both inner <span> tags start at the same indentation level
as the parent for consistent formatting.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 1fd39838-dcf6-490e-8bf8-7ffdb6d091c8

📥 Commits

Reviewing files that changed from the base of the PR and between c87cfed and 5814598.

📒 Files selected for processing (1)
  • src/components/video-editor/VideoEditor.tsx

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant