Skip to content

feat: move commit actions into a menu, with follow, mute, block and delete - #1371

Merged
nunomaduro merged 5 commits into
dev-null-sh:productionfrom
richardkeep:feat/commit-more-menu
Nov 3, 2026
Merged

nunomaduro merged 5 commits into
dev-null-sh:productionfrom
richardkeep:feat/commit-more-menu

Conversation

@richardkeep

@richardkeep richardkeep commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Each commit's actions row had separate Share and Report buttons on the right, and deleting your own commit used a trash icon in the header that only appeared on hover. These now sit in a single horizontal three-dot "More actions" menu. The menu also lets you follow, mute or block the commit's author without opening their profile or hover card.

The menu has three groups, separated by dividers:

  1. Copy link (the y shortcut still works) and Send in Remotes, when available.
  2. Follow/Unfollow, Mute/Unmute and Block/Unblock @handle, on other people's user commits. Guests only see Follow, which sends them to sign in.
  3. Report commit, when allowed, and Delete commit, on your own commits.

Changes

  • commit-secondary-actions.tsx: the Share dropdown and the Report button become one Ellipsis (horizontal three-dot) dropdown.
    • Send, Block, Report and Delete open their dialog or inline confirmation only after the menu has closed, using the same pending-action pattern Send already used. This means focus lands on the next control rather than being pulled back to the trigger.
    • Commits don't say whether you follow, mute or block their author. When the menu opens, the author items read that state from the cached user preview, then refresh it from the existing preview endpoint, and they stay disabled until it arrives.
    • Following uses the shared useIsFollowing state and followVisitOptions, so other follow controls on the page stay in sync.
    • Mute and unblock reuse the same visit and cache clearing as the hover card's menu, and also drop the author's cached preview so it isn't shown stale.
  • user-preview.tsx: adds usePreviewRelationship and forgetPreview, both built on the existing preview fetch and cache.
  • user-safety-menu.tsx: visitSafety() and BlockUserDialog are pulled out of UserSafetyMenu so both menus share them. UserSafetyMenu behaves as before.
  • commit-card.tsx: removes the hover trash button from the header, along with the logic that hid the hash so the button could replace it. Delete now opens the existing inline confirmation with the 30-second undo, and Cancel returns focus to the menu trigger. commit-thread.tsx's ThreadActions passes onDelete through.
  • commit-report-button.tsx: removes CommitReportButton, which is no longer used.
  • Tests:
    • CommitShareActions.test.tsx is updated for the menu. New tests cover the report and delete flows, the block confirmation, and the author items: loading state, follow and unfollow, guests, mute and unmute, block, and unblock.
    • FollowState.test.tsx now reaches the Block button through the extracted BlockUserDialog.

Validation

All run locally; hosted CI is pending.

  • Manual: checked in a desktop browser and on a phone by the PR author, who reported it looks fine.

  • bun run test:lint: pass.

  • bun run test:types: pass.

  • bun run test:unit: 218 pass, 1 fail. The failure, tests/Unit/RemotePushAccountIsolation.test.ts, also fails on the base revision.

  • vp test run --config tests/draft-images.config.ts on CommitShareActions.test.tsx and FollowState.test.tsx: 70/70 pass.

  • vendor/bin/pest --parallel --ci: 5217 passed. The --coverage --exactly=100.0 variant could not run locally because no coverage driver is installed. No PHP files changed.

Independent review

  • Reviewer: an independent read-only agent review.
  • Revision: base 6b534ca4, head b116e05d.
  • First pass (bef93080): FAIL. The new author items had no tests, and CommitReportButton was left unused. Both are fixed in e301e525.
  • Second pass (e301e525): PASS.
  • Third pass (b116e05d, which switches the trigger to horizontal dots): PASS.
  • Limits: it reviewed the code only and ran no browser checks.

Evidence

BEFORE (WEB)
image

AFTER (WEB)
image

BEFORE (MOBILE)
image

AFTER (MOBILE) - My Commit
image

AFTER (MOBILE) - Someone else's Commit
image

Summary by CodeRabbit

  • New Features
    • Commit actions are now grouped in a “More actions” menu, with reporting and permitted deletion available there.
    • For commits by other users, the menu can offer follow, mute, and block or unblock actions, subject to sign-in and relationship status.
    • Blocking requires confirmation.
  • Changes
    • The separate inline delete and report controls have been removed; deletion remains available through the menu when permitted.

@coderabbitai

coderabbitai Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Caution

Review failed

The pull request is closed.

Walkthrough

The commit menu now combines sharing with report, delete, and author relationship actions. Shared preview and safety helpers support relationship state and safety visits. Tests cover menu eligibility, action handling, and block confirmation.

Changes: Commit actions

Layer / File(s) Summary
Relationship state and safety actions
resources/js/components/user-preview.tsx, resources/js/components/user-safety-menu.tsx, tests/Unit/FollowState.test.tsx
Preview helpers expose cached author relationship state and clear previews. Safety visits share scroll, cache, and router handling. Block confirmation uses the exported BlockUserDialog.
More actions menu and commit integration
resources/js/components/commit-secondary-actions.tsx, resources/js/components/commit-card.tsx, resources/js/components/commit-thread.tsx, resources/js/components/commit-report-button.tsx, tests/Unit/CommitShareActions.test.tsx
The unified menu retains sharing and adds conditional report, delete, follow, mute, block, and unblock actions. Report and delete actions run after the menu closes. Commit and thread actions pass deletion callbacks. Tests cover action availability and behavior.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  actor User
  participant CommitMoreMenu
  participant CommitSecondaryActions
  participant BlockUserDialog
  participant visitSafety
  User->>CommitMoreMenu: Select block
  CommitMoreMenu->>CommitSecondaryActions: Dispatch pending action after menu closes
  CommitSecondaryActions->>BlockUserDialog: Open confirmation
  User->>BlockUserDialog: Confirm block
  BlockUserDialog->>visitSafety: Submit block visit
Loading

Possibly related issues

Suggested reviewers: mnapoli

Merge Risk: Low · previous review b116e

After blocking an author, the menu may briefly offer the wrong actions, or keep offering them if the preview refresh fails. This is a bounded issue to fix or accept before merging.

Security architecture risk: Low · up to b116e

Existing ownership and blocking checks remain authoritative. The main design sensitivity is keeping relationship status synchronized across controls; no new authorization bypass was established, but some cache and recovery behavior remains unverified.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The inspected mutation paths operate on the authenticated viewer's relationship to the selected author or on a commit the viewer owns. Menu placement increases convenience and caller reachability, but does not establish authority over another viewer's relationships or commits.

Security Findings and Attack Paths

  • inferred — A stale unblocked preview can expose Follow after blocking, but the inspected request authorization rejects following across either direction of a block. This stale-menu path therefore does not demonstrate a block bypass. Account-switch disclosure through the cache remains unverified rather than an established attack path.

Trust Boundaries and Controls

  • observed — Block creation transactionally records the block and removes follows in both directions. Mute creation uses duplicate-tolerant insertion; mute and block removal detach the current actor's relationship. Stale labels do not turn these endpoints into blind server-side toggles.

Resilience and Maintainability Implications

  • observed — Preview coherence is incomplete across consumers: block success updates shared follow/block keys but does not discard the preview, while forgetPreview only deletes an entry and cannot prevent an earlier fetch from repopulating it. The cache and block-success behavior predate this PR; the new menu adds another consumer whose safety labels depend on them.

Hardening Proposals

  • proposed — Consider one viewer-and-target-scoped relationship cache with shared mutation reconciliation and generation-checked refreshes. Include deferred block success and authentication transitions so stale responses cannot restore superseded relationship state. This is a hardening proposal, not a verified authorization finding.
Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: moving commit actions into a menu and adding follow, mute, block, and delete actions.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 12 functions across 7 files.

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Tip

🎯 Customize your risk assessments

Guide how CodeRabbit assesses merge risk and security architecture risk. Highlight sensitive changes and explain your security boundaries using Merge Risk Instructions and Security Risk Instructions in your review settings. Security architecture risk assessments require the Advanced plan or above.

✅ Automatic approvals, with your rules

Let CodeRabbit approve pull requests once required threads are resolved, pre-merge checks pass, and your risk limits are met. Enable Automatic approvals in review settings, with overrides for teams or file paths.

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.
Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 810a7e87-42f7-4f51-9959-7b42944f1c04
Commits

Reviewing files that changed from the base of the PR and between 6b534ca and b116e05.

Files selected for processing: 8
  • resources/js/components/commit-card.tsx
  • resources/js/components/commit-report-button.tsx
  • resources/js/components/commit-secondary-actions.tsx
  • resources/js/components/commit-thread.tsx
  • resources/js/components/user-preview.tsx
  • resources/js/components/user-safety-menu.tsx
  • tests/Unit/CommitShareActions.test.tsx
  • tests/Unit/FollowState.test.tsx
Files with no reviewable changes: 1
  • resources/js/components/commit-report-button.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@richardkeep
richardkeep marked this pull request as ready for review November 3, 2026 18:45

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

  • Fix comments: Fix CodeRabbit comments on this PR

…ore-menu

# Conflicts:
#	resources/js/components/commit-card.tsx
#	resources/js/components/user-safety-menu.tsx
@nunomaduro
nunomaduro marked this pull request as draft November 3, 2026 19:00
@richardkeep
richardkeep marked this pull request as ready for review November 3, 2026 19:05
@nunomaduro
nunomaduro merged commit e1fb7d2 into dev-null-sh:production Nov 3, 2026
1 check failed
@richardkeep
richardkeep deleted the feat/commit-more-menu branch November 3, 2026 19:08
nunomaduro pushed a commit that referenced this pull request Nov 11, 2026
Since the commit actions moved into a menu (#1371), its 28px button sits
in the actions row at every width, hidden but still taking room. The row
is now 28px tall everywhere, centred 14px up, while from md the end dot
and the reply spine running into it still sat 12px up, so the dot was
2px below the icons. Both now sit 14px up at every width.

Co-authored-by: Claude Opus 5.5 <[email protected]>
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