-
Notifications
You must be signed in to change notification settings - Fork 4.6k
feat(timeline): implement track visibility toggle #681
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
base: main
Are you sure you want to change the base?
feat(timeline): implement track visibility toggle #681
Conversation
- Fix OpenCut-app#658: Add hidden property to TimelineTrack interface - Add toggleTrackVisibility function to timeline store - Update Eye button to toggle between Eye/EyeOff icons - Add visual feedback (opacity) for hidden tracks - EyeOff icon shown in red when track is hidden
|
@ThanhNguyxn is attempting to deploy a commit to the OpenCut OSS Team on Vercel. A member of the Team first needs to authorize it. |
👷 Deploy request for appcut pending review.Visit the deploys page to approve it
|
📝 WalkthroughWalkthroughAdds per-track visibility: a new optional Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant TimelineUI as Timeline UI
participant Store as Timeline Store
participant History as History Manager
participant Persist as Persist/Save
User->>TimelineUI: Click visibility button (trackId)
TimelineUI->>Store: toggleTrackVisibility(trackId)
Store->>Store: toggle track.hidden
Store->>History: pushHistory(change)
Store->>Persist: updateTracksAndSave(tracks)
Persist-->>Store: save acknowledged
Store-->>TimelineUI: updated state
TimelineUI-->>User: re-render showing Eye/EyeOff and opacity
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
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. 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.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@apps/web/src/components/editor/timeline/index.tsx`:
- Around line 793-803: The visibility toggle uses SVG icons (Eye / EyeOff) which
are not keyboard-focusable; wrap the icons in a focusable button element (or
your Button component) and move the onClick to that button, add an appropriate
aria-label (e.g., `aria-label={track.hidden ? "Show track" : "Hide track"}`) and
preserve the call to toggleTrackVisibility(track.id); ensure the button has no
disruptive styles (use className on the button for cursor/colour) so visual
appearance is unchanged and keyboard users can activate the control.
- Address CodeRabbit feedback for keyboard accessibility - Wrap mute and visibility toggle icons in button elements - Add aria-labels for screen readers - Add focus ring styles for keyboard navigation
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.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@apps/web/src/components/editor/timeline/index.tsx`:
- Around line 782-805: Add <title> child elements to each Lucide icon instance
to satisfy SVG accessibility guidelines: for the icons VolumeOff, Volume2, Eye,
and EyeOff used inside the buttons that call toggleTrackMute(track.id) and
toggleTrackVisibility(track.id), render a <title> with a concise label matching
the button aria-label (e.g., "Mute track" / "Unmute track" for Volume icons and
"Hide track" / "Show track" for Eye icons). Ensure each icon receives the
correct title based on the track.muted and track.hidden boolean states so the
SVGs have accessible titles that align with the existing aria-labels.
Summary
This PR implements the missing track visibility toggle functionality on the timeline.
Fixes #658 - Non-functional Eye Button on Timeline Track
Problem:
Solution:
Added
hiddenproperty to TimelineTrack interface (types/timeline.ts)hidden?: booleanpropertyAdded
toggleTrackVisibilityfunction (stores/timeline-store.ts)toggleTrackMutefunctionUpdated Eye button in timeline UI (
components/editor/timeline/index.tsx)EyeOffimport from lucide-reactcursor-pointerclass for better UXtext-destructive) when track is hiddenAdded visual feedback for hidden tracks (
components/editor/timeline/timeline-track.tsx)opacity-40)Visual Changes
Testing
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.