Skip to content

refactor: Resizable Video Editor Layout, Migrated inline styles to TailwindCSS#228

Merged
siddharthvaddem merged 1 commit intosiddharthvaddem:mainfrom
prayaslashkari:feature/resizeable-video-editor
Mar 17, 2026
Merged

refactor: Resizable Video Editor Layout, Migrated inline styles to TailwindCSS#228
siddharthvaddem merged 1 commit intosiddharthvaddem:mainfrom
prayaslashkari:feature/resizeable-video-editor

Conversation

@prayaslashkari
Copy link
Copy Markdown
Contributor

@prayaslashkari prayaslashkari commented Mar 17, 2026

Pull Request Template

Description

  • A horizontal PanelGroup splitting the video/timeline area (left) from the settings panel (right), with a draggable resize handle between them.
  • A vertical PanelGroup within the left column, splitting the video preview (top) from the timeline (bottom), also with a draggable resize handle.
  • Constraints (minSize, maxSize) on each panel to prevent collapsing or over-expanding.
  • Inline CSS migrated to Tailwind classes for consistency and maintainability.

Motivation

Made the panels resizable both horizontally and vertically with added constraints.

Type of Change

  • New Feature
  • Bug Fix
  • Refactor / Code Cleanup
  • Documentation Update
  • Other (please specify)

Related Issue(s)

Screenshots / Video

n/a

Video (if applicable):

resizeable-windows.mov

Testing

Checklist

  • I have performed a self-review of my code.
  • I have added any necessary screenshots or videos.
  • I have linked related issue(s) and updated the changelog if applicable.

Thank you for contributing!

Summary by CodeRabbit

  • New Features
    • Reorganized video editor into a horizontal three-panel layout (left video, middle timeline, right settings) with resizable dividers for flexible workspace sizing.
    • Timeline restored as a dedicated, resizable middle panel.
    • Video playback preview and controls moved into the top video panel with updated sizing and wrappers.
    • Settings panel repositioned to the right to match the new layout.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 17, 2026

📝 Walkthrough

Walkthrough

The VideoEditor layout is restructured from a vertical stack to a horizontal three-panel PanelGroup: a left video panel (with playback and controls), a central resizable Timeline panel, and a right Settings panel. PanelResizeHandle components enable adjustable widths; existing callbacks and data bindings are preserved.

Changes

Cohort / File(s) Summary
VideoEditor Layout Restructuring
src/components/video-editor/VideoEditor.tsx
Replaces vertical layout with a horizontal PanelGroup comprising left video panel (video preview and PlaybackControls), middle resizable TimelineEditor panel, and right resizable SettingsPanel. Adds PanelResizeHandle instances, updates wrappers/aspect-ratio handling and classNames; preserves all existing props, callbacks, and export/reporting logic.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐇 I hopped through panels, left to right,
I nudged the handles, soft and light,
The timeline stretched, the settings gleamed,
Playback hummed, the layout beamed,
A rabbit's tweak — UI done right. 🥕

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

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.
✅ Passed checks (2 passed)
Check name Status Explanation
Description check ✅ Passed The description covers the main structural changes (PanelGroups, resize handles, constraints) and the styling migration. Most template sections are addressed with reasonable detail; testing steps are missing but other core information is provided.
Title check ✅ Passed The title accurately captures both main changes: introducing a resizable panel layout and migrating inline styles to Tailwind CSS, which align with the file changes and PR objectives.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
📝 Coding Plan
  • Generate coding plan for human review comments

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

@prayaslashkari prayaslashkari changed the title Refactor: Update VideoEditor layout, Migrated inline styles to TailwindCSS Refactor: Resizable Video Editor Layout, Migrated inline styles to TailwindCSS Mar 17, 2026
@prayaslashkari prayaslashkari marked this pull request as ready for review March 17, 2026 06:07
Copy link
Copy Markdown
Contributor

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

Actionable comments posted: 1

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

1235-1244: Deduplicate video dimension/aspect-ratio derivation.

The same videoPlaybackRef.current?.video fallback logic appears in multiple places. Extracting shared derived values once per render reduces drift risk between preview and settings calculations.

Also applies to: 1384-1389

🤖 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 1235 - 1244,
Extract the repeated fallback logic around videoPlaybackRef.current?.video into
a single derived-constants block at the top of the render (e.g., const
currentVideo = videoPlaybackRef.current?.video, const currentVideoWidth =
currentVideo?.videoWidth || 1920, const currentVideoHeight =
currentVideo?.videoHeight || 1080), then use those constants wherever the code
calls getNativeAspectRatioValue(...) or otherwise reads video dimensions
(including the calls inside the VideoEditor component that reference cropRegion
and getAspectRatioValue). Replace every inline occurrence of
videoPlaybackRef.current?.video?.videoWidth/videoHeight with
currentVideoWidth/currentVideoHeight and pass those into
getNativeAspectRatioValue and related calculations to ensure a single source of
truth per render and eliminate duplicated fallback logic.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/components/video-editor/VideoEditor.tsx`:
- Around line 1295-1297: Add explicit resize cursor and keyboard focus-visible
styles to the PanelResizeHandle elements to improve affordance and
accessibility: update the PanelResizeHandle (the instances rendering the div
with className "w-8 h-1 bg-white/20 rounded-full") to include cursor-col-resize
(or a responsive cursor for horizontal/vertical as appropriate) and
focus-visible utility classes (e.g., outline-none focus-visible:ring-2
focus-visible:ring-offset-1 focus-visible:ring-indigo-500 or similar) so
keyboard users see a clear focus ring and pointer users see a resize cursor;
apply the same change to both PanelResizeHandle occurrences (the handle around
the small bar near the first instance and the repeating instance at the second
location).

---

Nitpick comments:
In `@src/components/video-editor/VideoEditor.tsx`:
- Around line 1235-1244: Extract the repeated fallback logic around
videoPlaybackRef.current?.video into a single derived-constants block at the top
of the render (e.g., const currentVideo = videoPlaybackRef.current?.video, const
currentVideoWidth = currentVideo?.videoWidth || 1920, const currentVideoHeight =
currentVideo?.videoHeight || 1080), then use those constants wherever the code
calls getNativeAspectRatioValue(...) or otherwise reads video dimensions
(including the calls inside the VideoEditor component that reference cropRegion
and getAspectRatioValue). Replace every inline occurrence of
videoPlaybackRef.current?.video?.videoWidth/videoHeight with
currentVideoWidth/currentVideoHeight and pass those into
getNativeAspectRatioValue and related calculations to ensure a single source of
truth per render and eliminate duplicated fallback logic.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8075ce45-3568-4a51-8e79-4cfa9dbbe204

📥 Commits

Reviewing files that changed from the base of the PR and between 881acdb and 987a7c6.

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

Comment thread src/components/video-editor/VideoEditor.tsx
@prayaslashkari prayaslashkari force-pushed the feature/resizeable-video-editor branch from 987a7c6 to 9a5d94a Compare March 17, 2026 16:59
Copy link
Copy Markdown
Contributor

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

♻️ Duplicate comments (1)
src/components/video-editor/VideoEditor.tsx (1)

1295-1297: ⚠️ Potential issue | 🟡 Minor

Add resize cursor + focus-visible styles on handles.

Line 1295 and Line 1340 still miss explicit resize cursor and keyboard focus-ring styles, which weakens discoverability/accessibility.

Suggested patch
-<PanelResizeHandle className="bg-[`#09090b`]/80 hover:bg-[`#09090b`] transition-colors rounded-full flex items-center justify-center">
+<PanelResizeHandle className="bg-[`#09090b`]/80 hover:bg-[`#09090b`] transition-colors rounded-full flex items-center justify-center cursor-row-resize focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[`#34B27B`]/70">
   <div className="w-8 h-1 bg-white/20 rounded-full"></div>
 </PanelResizeHandle>

-<PanelResizeHandle className="h-full bg-[`#09090b`]/80 hover:bg-[`#09090b`] transition-colors rounded-full flex items-center justify-center">
+<PanelResizeHandle className="h-full bg-[`#09090b`]/80 hover:bg-[`#09090b`] transition-colors rounded-full flex items-center justify-center cursor-col-resize focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[`#34B27B`]/70">
   <div className="w-1 h-8 bg-white/20 rounded-full"></div>
 </PanelResizeHandle>

Also applies to: 1340-1342

🤖 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 1295 - 1297, The
PanelResizeHandle elements (component name: PanelResizeHandle) are missing
explicit resize cursors and keyboard focus-visible ring styles; update the
className for each PanelResizeHandle instance (the one around the small div at
the split panes) to include a proper resize cursor (e.g., cursor-col-resize or
cursor-row-resize as appropriate) and focus-visible utilities (e.g.,
focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-1
focus-visible:ring-color) so keyboard users get a visible focus ring and pointer
users see the resize cursor; ensure both occurrences (the handle near the top
and the one near line ~1340) are updated.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@src/components/video-editor/VideoEditor.tsx`:
- Around line 1295-1297: The PanelResizeHandle elements (component name:
PanelResizeHandle) are missing explicit resize cursors and keyboard
focus-visible ring styles; update the className for each PanelResizeHandle
instance (the one around the small div at the split panes) to include a proper
resize cursor (e.g., cursor-col-resize or cursor-row-resize as appropriate) and
focus-visible utilities (e.g., focus:outline-none focus-visible:ring-2
focus-visible:ring-offset-1 focus-visible:ring-color) so keyboard users get a
visible focus ring and pointer users see the resize cursor; ensure both
occurrences (the handle near the top and the one near line ~1340) are updated.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 53c09b6e-3e42-4948-aa1a-3d686686b331

📥 Commits

Reviewing files that changed from the base of the PR and between 987a7c6 and 9a5d94a.

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

@prayaslashkari prayaslashkari changed the title Refactor: Resizable Video Editor Layout, Migrated inline styles to TailwindCSS reafactor: Resizable Video Editor Layout, Migrated inline styles to TailwindCSS Mar 17, 2026
@prayaslashkari prayaslashkari changed the title reafactor: Resizable Video Editor Layout, Migrated inline styles to TailwindCSS refactor: Resizable Video Editor Layout, Migrated inline styles to TailwindCSS Mar 17, 2026
@siddharthvaddem siddharthvaddem merged commit 0935dac into siddharthvaddem:main Mar 17, 2026
5 checks passed
@coderabbitai coderabbitai bot mentioned this pull request Mar 22, 2026
8 tasks
@coderabbitai coderabbitai bot mentioned this pull request Apr 2, 2026
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.

2 participants