Commit Graph

38 Commits

Author SHA1 Message Date
Nic Luckie d3e6302526 refactor: simplify access token toast and remove unnecessary fragment wrapper
- 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
2025-09-26 20:57:38 -04:00
Nic Luckie c7b53930cc Update CreateAccessTokenDialog and AccessTokenSection; improve handling 2025-09-25 19:26:33 -04:00
Nic Luckie ea3b6a7c77 refactor(ui): remove Markdown rendering from ConfirmDialog component
- 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
2025-09-24 11:47:55 -04:00
Nic Luckie 9beb6ca5c1 fix(web): improve destructive flows, i18n specificity, and remove unused attachments dialog
- 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
2025-09-23 21:51:32 -04:00
Nic Luckie 30795d1d9c feat(web): introduce accessible ConfirmDialog and migrate confirmations; add Markdown-safe descriptions
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.
2025-09-20 12:08:07 -04:00
Johnny 0b4252d1a3 chore: fix linter 2025-08-25 19:52:53 +08:00
Johnny cf29684882 chore: tweak links 2025-08-25 19:51:01 +08:00
Johnny 240d89fbca feat: migrate dialogs 2025-07-06 22:01:55 +08:00
Johnny 41fdc7a484 chore: fix frontend linter 2025-07-05 11:44:01 +08:00
Johnny 91be2f68d1
feat: variant colors (#4816) 2025-07-04 23:03:13 +08:00
Johnny 493832aeb4 refactor: unify components 2025-07-01 19:29:48 +08:00
Steven c9ab03e1a0 refactor: user service 2025-06-16 21:49:38 +08:00
Johnny 522da2a114 fix: border color 2025-06-08 00:39:51 +08:00
Steven 606924b4c9 chore: unify form styles 2025-05-15 22:15:01 +08:00
Pierre Quillery cdadf133d0
chore: adding missing translations (#4273)
* Added missing translations strings (filters, about page, ...)

* Forgot one translation string.

* Fixed PR issues and added Access Token related missing translation strings.

* Fixed eslint issues.

* Fixed eslint issues #2.

* Fixed access token dialog translations, added missing webhook dialog translations.
2025-01-08 10:24:41 +08:00
johnnyjoy 227cc26cb9 chore: align table styles for access token section 2024-11-03 20:28:42 +08:00
Daniel Pinto f44583e87d
chore: allow some hardcoded strings to be translated (#4076)
Allow some hardcoded strings to be translated

Also add pt-PT translation for them
2024-11-02 10:36:11 +08:00
Steven 963706aebd refactor: update button source 2024-10-26 21:36:05 +08:00
Michel Heusschen 2dbf92f7f1
perf: reduce bundle size by 21% with direct icon imports (#3844) 2024-08-28 22:55:28 +08:00
Steven 1ad5d9bf0a chore: update confirm dialog 2024-07-01 23:22:39 +08:00
Steven 05c6edfe2f chore: tweak auth pages 2024-06-26 22:11:18 +08:00
Steven 1b291422e7 refactor: api version 2024-04-28 00:44:29 +08:00
Steven 436a6cb084 chore: fix text truncate 2024-04-08 19:20:16 +08:00
Steven 1994c20c54 chore: tweak setting page 2024-01-11 22:25:05 +08:00
Steven 8e325f9986 chore: return username in user response 2023-12-23 19:23:39 +08:00
Steven c24181b2be chore: fix jwt checks 2023-11-05 23:39:30 +08:00
Steven 39a0e69b04 chore: update function name 2023-11-05 23:28:09 +08:00
Steven e60e47f76f chore: update user definition 2023-11-05 23:03:43 +08:00
Steven 9859d77cba chore: update links 2023-10-26 09:00:36 +08:00
Steven 0d803bf45f chore: update dark mode styles 2023-09-23 20:30:47 +08:00
Steven 5cec1a71da chore: update access token generator 2023-09-20 20:48:34 +08:00
Steven bff41a8957 fix: invalid username checks 2023-09-18 22:34:31 +08:00
boojack b13042d644
chore: move buf generated code to gitignore (#2236) 2023-09-17 20:55:05 +08:00
Steven d09e3c3658 chore: remove buf es generator 2023-09-17 20:14:45 +08:00
Steven b233eaea97 chore: update docs link 2023-09-16 12:25:57 +08:00
Steven fb1490c183 feat: impl resources list page 2023-09-16 11:48:53 +08:00
Steven d1156aa755 chore: update account setting styles 2023-09-15 22:09:51 +08:00
Steven f5802a7d82 chore: update access token ui 2023-09-15 08:18:30 +08:00