Skip to content

refactor: Use the same controls for audio and video players - #2090

Open
BaptGrv wants to merge 5 commits into
masterfrom
refactor/audio-view
Open

BaptGrv wants to merge 5 commits into
masterfrom
refactor/audio-view

Conversation

@BaptGrv

@BaptGrv BaptGrv commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI balanced review requested due to automatic review settings November 24, 2026 14:02

Copilot AI 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.

🟡 Changes recommended

The unit-test target cannot compile because its fixture assigns a now-private constant, and duration updates incorrectly reset audio playback progress to zero.

2 open issues
What changed in this PR

This PR unifies audio and video preview controls, shares their layout logic, and adjusts file-action panel handling during navigation transitions.

Changes:

  • Reuses video controls for audio playback and removes the separate audio controls view.
  • Converts the video preview cell from XIB-based to programmatic initialization.
  • Updates shared control positioning and file-action panel dismissal and presentation handling.
File Description
kDrive/​UI/​View/​Files/​Preview/​VideoControlsView.swift Exposes the AirPlay button so audio previews can hide it.
kDrive/​UI/​View/​Files/​Preview/​VideoCollectionViewCell.xib Removes the video cell’s XIB.
kDrive/​UI/​View/​Files/​Preview/​VideoCollectionViewCell.swift Builds the cell programmatically and uses shared control layout.
kDrive/​UI/​View/​Files/​Preview/​PreviewCollectionViewCell.swift Centralizes playback-control positioning.
kDrive/​UI/​View/​Files/​Preview/​AudioControlsView.swift Removes the dedicated audio controls implementation.
kDrive/​UI/​View/​Files/​Preview/​AudioCollectionViewCell.swift Adopts shared playback controls and updates playback observations.
kDrive/​UI/​Controller/​MainTabViewController.swift Dismisses file actions before preview handoffs.
kDrive/​UI/​Controller/​Files/​Preview/​PreviewViewController+Layout.swift Refreshes control layout for all preview cell types.
kDrive/​UI/​Controller/​Files/​Preview/​PreviewViewController.swift Registers the programmatic video cell and adjusts panel and remote-control handling.

Review effort: Balanced

@BaptGrv
BaptGrv force-pushed the refactor/audio-view branch 2 times, most recently from 2c43c6c to 25feabb Compare November 24, 2026 14:11
@BaptGrv
BaptGrv force-pushed the refactor/audio-view branch from a75c755 to 0984a41 Compare November 30, 2026 07:35
@sonarqubecloud

Copy link
Copy Markdown

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