feat: Add per-cap controls to header #1527
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
what does this pr do
This PR adds per-cap management controls directly to the Share page header (/s/[videoId]) for cap owners. Previously, these actions were only available from the dashboard card dropdown. This improves usability by letting owners manage their cap without leaving the share page.
fixes #1526
fixes CAP-607
Greptile Summary
Added per-cap management controls to the Share page header, bringing Settings, Analytics, Download, Duplicate, Password, and Delete actions directly to the
/s/[videoId]page for cap owners. Previously these controls were only accessible from the dashboard card dropdown.Key changes:
CapOptionsDropdowncomponent mirroring the dashboard card dropdown functionalityShareHeaderwith comprehensive dropdown menu (owner-only)SettingsDialogto work outside dashboard context by accepting optionalisProprop with fallback logicvideoSettingsdata from page through to header for settings dialogImplementation details:
CapCard.tsxdropdown implementation/dashboard/caps(consistent with dashboard behavior)SettingsDialog,PasswordDialog,ConfirmationDialogConfidence Score: 5/5
Important Files Changed
Sequence Diagram
sequenceDiagram participant User participant ShareHeader participant CapOptionsDropdown participant SettingsDialog participant PasswordDialog participant ConfirmationDialog participant RPC participant Router User->>ShareHeader: View cap share page ShareHeader->>ShareHeader: Check if user is owner alt User is owner ShareHeader->>CapOptionsDropdown: Render dropdown with owner controls User->>CapOptionsDropdown: Click options button CapOptionsDropdown->>User: Show dropdown menu alt Settings action User->>CapOptionsDropdown: Click Settings CapOptionsDropdown->>SettingsDialog: Open dialog with isPro flag SettingsDialog->>User: Show settings options User->>SettingsDialog: Modify settings SettingsDialog->>RPC: updateVideoSettings() RPC-->>SettingsDialog: Success SettingsDialog->>Router: refresh() end alt Analytics action User->>CapOptionsDropdown: Click View analytics CapOptionsDropdown->>Router: Navigate to analytics page end alt Download action User->>CapOptionsDropdown: Click Download CapOptionsDropdown->>RPC: VideoGetDownloadInfo() RPC-->>CapOptionsDropdown: Download URL CapOptionsDropdown->>User: Trigger file download end alt Duplicate action User->>CapOptionsDropdown: Click Duplicate CapOptionsDropdown->>RPC: VideoDuplicate() RPC-->>CapOptionsDropdown: Success CapOptionsDropdown->>Router: refresh() end alt Password action User->>CapOptionsDropdown: Click Add/Edit password alt User is not Pro CapOptionsDropdown->>User: Show upgrade modal else User is Pro CapOptionsDropdown->>PasswordDialog: Open dialog PasswordDialog->>User: Manage password PasswordDialog->>RPC: Update password RPC-->>PasswordDialog: Success PasswordDialog->>Router: refresh() end end alt Delete action User->>CapOptionsDropdown: Click Delete Cap CapOptionsDropdown->>ConfirmationDialog: Show confirmation User->>ConfirmationDialog: Confirm deletion ConfirmationDialog->>RPC: VideoDelete() RPC-->>ConfirmationDialog: Success ConfirmationDialog->>Router: Navigate to dashboard end end