Skip to content

fix(comments): restore rounded corners on inline video player#4706

Merged
hm21 merged 4 commits into
mainfrom
fix/dm-co-post-request-shadow-overlay
May 25, 2026
Merged

fix(comments): restore rounded corners on inline video player#4706
hm21 merged 4 commits into
mainfrom
fix/dm-co-post-request-shadow-overlay

Conversation

@hm21
Copy link
Copy Markdown
Contributor

@hm21 hm21 commented May 25, 2026

Closes #4707

Description

A previous refactor of VideoCommentPlayer removed its outer ClipRRect, which inadvertently dropped the rounded corners on inline video previews inside comment items. This PR restores the rounded corners at the caller side and includes a visual redesign of CollaboratorInviteCard._CardChrome.

  • comment_item.dart: wrap VideoCommentPlayer in ClipRRect(borderRadius: BorderRadius.circular(12)) inside the existing Align + ConstrainedBox(maxWidth: 248), restoring the previous visual.
  • collaborator_invite_card.dart:
    • Background BoxDecoration now includes borderRadius: BorderRadius.circular(16) so the fill is rounded.
    • Border moved from decoration to foregroundDecoration — it now paints on top of the content, which means the border is never obscured by video content bleeding to the edge.
    • Added clipBehavior: Clip.antiAlias on the outer Container — clips the video player (and all other children) to the 16 px rounded corners so no content overflows the card boundary.
    • Switched EdgeInsetsGeometry.fromSTEB to EdgeInsetsDirectional.fromSTEB(12, 48, 12, 12) so padding mirrors correctly in RTL locales.
  • comment_item_test.dart: add a regression test (wraps the inline video player with rounded corners) that asserts the ClipRRect ancestor and its 12 px radius. Sets VisibilityDetectorController.instance.updateInterval = Duration.zero in setUpAll to prevent the visibility_detector timer from leaking into other tests (matches the existing pattern in video_comment_player_test.dart and visibility_aware_video_test.dart).
  • collaborator_invite_card_test.dart: add regression tests for the _CardChrome visual redesign — asserts Clip.antiAlias is set, foregroundDecoration has a border, and sent/received cards align to the correct end of the row.
Before After
before after

Related Issue: N/A — follow-up to commit a95b8d78 on this branch.

Out of Scope

None.

Verification

  • flutter test test/screens/comments/comment_item_test.dart → 7/7 pass
  • flutter test test/screens/inbox/conversation/widgets/collaborator_invite_card_test.dart → 4/4 pass
  • flutter analyze lib test integration_test

Type of Change

  • 🛠️ Bug fix (non-breaking change which fixes an issue)

@github-actions

This comment has been minimized.

Copy link
Copy Markdown
Contributor

@realmeylisdev realmeylisdev left a comment

Choose a reason for hiding this comment

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

Review summary (detailed findings inline)

The code I traced is correct and the comments path is tested + analyzer-clean. The main concern isn't a bug — it's that the PR description hides the larger half of the change.

Net change vs main: VideoCommentPlayer's internal ClipRRect(12) is removed (in this PR, commit 4176d1742) and re-added at the comment caller → net-zero for comments; and the DM collaborator-invite card is visually redesigned (16px container clip, foreground border, edge-to-edge gradient). VideoCommentPlayer is shared by exactly these two callers, so bundling them in one PR is correct — the issue is purely the description.

Top asks (see inline):

  1. Rewrite the description to cover the invite-card redesign and attach a before/after screenshot of the card — the body currently calls it a "switch to EdgeInsetsDirectional … for RTL."
  2. Add a test/golden for collaborator_invite_card.dart; its redesign is uncovered by CI today.
  3. (Consider) keep the clip inside VideoCommentPlayer behind a radius param to avoid the encapsulation footgun that caused this very regression.

Description nits: the cited ancestor commit a95b8d78 doesn't exist in the repo; "7/7 pass" is actually 5/5 (I ran the file).

Housekeeping: branch is 1 commit behind origin/main (ff9356f0d, unrelated message_input_bar — no file overlap, clean rebase). Please rebase before merge.

Verified locally: flutter test test/screens/comments/comment_item_test.dart ✅ all pass; flutter analyze on all 4 changed files ✅ no issues; invite-card video still clipped via the container's clipBehavior: Clip.antiAlias.

Comment thread mobile/lib/screens/comments/widgets/video_comment_player.dart
Comment thread mobile/lib/screens/comments/widgets/comment_item.dart
Comment thread mobile/test/screens/comments/comment_item_test.dart Outdated
@hm21 hm21 self-assigned this May 25, 2026
@github-actions
Copy link
Copy Markdown

Mobile PR Preview

Preview refreshed for 16aab7b

Last refresh: 16aab7b at 2026-05-25 11:18:43 UTC (preview run)

Property Value
Preview URL https://a985e284.openvine-app.pages.dev
Pages project openvine-app
Preview branch pr-4706
PR branch fix/dm-co-post-request-shadow-overlay
Commit 16aab7b

@hm21 hm21 requested a review from realmeylisdev May 25, 2026 11:21
Copy link
Copy Markdown
Contributor

@realmeylisdev realmeylisdev left a comment

Choose a reason for hiding this comment

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

Re-review — approving ✅

Thanks for the quick turnaround on 16aab7b. Verified locally: comment_item_test.dart + the new collaborator_invite_card_test.dart both pass (9 tests total) and flutter analyze is clean on both.

Resolved from my review:

  • ✅ Invite-card redesign is now documented in the PR body and covered by collaborator_invite_card_test.dart (container clip @ 16, foreground border, sent/received alignment).
  • ✅ Fragile ClipRRect finder now guarded with findsOneWidget.
  • ✅ Caller-owned clip design — agreed, and the new tests guard both call sites against the regression I flagged.

Correction on my end: I incorrectly said the before/after screenshots were the comments view — they're the invite card, and they show the redesign clearly (inset gradient panel → edge-to-edge). Apologies for that.

Optional, non-blocking (won't hold the merge):

  • PR body still cites "follow-up to commit a95b8d78" — that SHA isn't in the branch; worth dropping or correcting.
  • Verification line says comment_item_test.dart → 7/7; it's 5 tests.
  • Please rebase onto origin/main before merge (1 commit behind ff9356f0d, no conflicts).

Nice work — approving.

@hm21 hm21 merged commit b4303d8 into main May 25, 2026
10 checks passed
@hm21 hm21 deleted the fix/dm-co-post-request-shadow-overlay branch May 25, 2026 15:03
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.

fix(comments): restore rounded corners on inline video player

2 participants