- Removed redundant React fragment in Attachments.tsx for cleaner structure
- Removed fallback logic for access token description in toast; use created.description directly since description is always required by client-side validation.
- Removed unused i18n key access-token-created-default since description is always present
- Removed Markdown rendering capability from ConfirmDialog component
- Removed marked library dependency from package.json and lockfile
- Updated all component usages to use plain text descriptions
- Converted irreversible action warnings from Markdown to plain text
- Simplified component API by removing descriptionMarkdown prop
- Updated ConfirmDialog README to reflect simplified implementation
- Retained DOMPurify dependency for other components that need it
- Updated en.json translations to remove Markdown formatting
- Fixed potential undefined username toast in MemberSection by storing username locally before clearing target state
- Standardized data-loading attribute on confirm button to use boolean value directly
- Attachments: reverted unused bulk "Delete all unused" ConfirmDialog and pruned related unused vars (flow not user-triggered)
- Members: capture username before clearing archive/delete targets to avoid brittle state reads
- Access tokens: capture fields before clearing delete target; safe toast + functional state update
- Sessions: use “Revoke” label instead of generic delete wording
- Tags: replace incorrect generic deletion success message with tag.delete-success i18n key
- ConfirmDialog: restructured into its own folder (index + module + README) to align with component organization guidelines
- General: eliminate reliance on reading state immediately after reset; tighten handler robustness
Why
- window.confirm is not supported on Brave Mobile for iOS, which blocked destructive actions like deleting memos. Replacing it with an accessible, app-native dialog restores mobile functionality and improves UX.
What changed
- New ConfirmDialog component
- Replaces window.confirm usage across the app.
- Props: open/onOpenChange, title, description or descriptionMarkdown, confirm/cancel labels, onConfirm, confirmVariant.
- Prevents double-submit and accidental dismiss while confirming (loading state).
- Markdown support for dialog descriptions
- descriptionMarkdown renders via marked and is sanitized with DOMPurify before injection.
- Keeps translations readable (Markdown) and safe (sanitized HTML).
- Member management flows
- Updated archive/delete dialogs to use ConfirmDialog.
- Added toast notifications for archive, restore, and delete actions.
- i18n: added/updated relevant translation keys (en).
Accessibility and mobile
- Dialog buttons are touch-friendly.
- Escape and outside-click behavior matches expectations.
Manual Tests - Verified in Brave desktop (v1.82.166) and Brave for iOS (v1.81 (134))
- Memos:
- Archive → confirm archival and shows success toast.
- Restore (only when archived) → confirm restoration and shows success toast.
- Delete → destructive dialog → confirm deletion and shows success toast.
- Shortcuts: create → menu → Delete → dialog appears; cancel keeps; confirm deletes and list refreshes.
- Access tokens: Settings → Access Tokens → Delete → dialog title shows masked token; confirm deletes.
- Members: Settings → Members → non-current user:
- Archive → warning dialog → confirm archives.
- Delete (only when archived) → destructive dialog → confirm deletes.
- Sessions: Settings → Sessions → Revoke non-current session → dialog appears; confirm revokes; current session remains disabled.
- Webhooks: Settings → Webhooks → Delete → dialog appears; confirm deletes and list refreshes.
- Mobile/accessibility: focus trap, inert background, tappable buttons, Escape/outside-click behavior verified.
Notes / follow-ups
- Deleting a member currently removes the account but does not cascade-delete the member’s content. Not sure if this is intended or not, so I left the warning description more general for now.