web: fix delete comment, spaces custom domain link#1159
Conversation
WalkthroughRefactors CapCard to derive domain info from context and consolidate copy-link logic into a new internal handler. Updates Comment component’s delete flow by requiring a concrete parentId (nullable), making confirmation unconditional, and invoking onDelete with explicit null when no parent exists. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor User
participant CapCard UI
participant CapCard Logic as CapCard copyLinkHandler
participant Clipboard
User->>CapCard UI: Click "Copy link"
CapCard UI->>CapCard Logic: Request URL for copy
CapCard Logic->>CapCard Logic: Read activeOrganization from context
CapCard Logic->>CapCard Logic: Derive customDomain/domainVerified
CapCard Logic->>CapCard Logic: Construct URL (env/custom domain)
CapCard Logic->>Clipboard: WriteText(URL)
Clipboard-->>CapCard Logic: Success/Failure
CapCard Logic-->>CapCard UI: Update copyPressed state
Note over CapCard Logic,CapCard UI: Centralized link construction replaces inline logic
sequenceDiagram
autonumber
actor User
participant Comment UI
participant Confirm Dialog
participant Parent Handler as onDelete(commentId, parentId|null)
User->>Comment UI: Click "Delete"
Comment UI->>Confirm Dialog: Prompt delete confirmation (unconditional)
alt User confirms
Comment UI->>Parent Handler: onDelete(comment.id, comment.parentCommentId or null)
else User cancels
Comment UI-->>User: No action
end
Note over Comment UI: parentId is now explicit null when absent
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary by CodeRabbit
New Features
Bug Fixes