Skip to content

AP 019: Expand reusable component library ( FormField, Pagination, ConfirmDialog, EmptyState, Toast) - #498

Open
pratigya245 wants to merge 5 commits into
mainfrom
pratigya245/feature/ap-019-components
Open

AP 019: Expand reusable component library ( FormField, Pagination, ConfirmDialog, EmptyState, Toast)#498
pratigya245 wants to merge 5 commits into
mainfrom
pratigya245/feature/ap-019-components

Conversation

@pratigya245

Copy link
Copy Markdown
Collaborator

Adds a shared component library for the Admin Panel frontend under src/components/:

  • FormField — label + input/select/textarea + hint/error, replaces hand-rolled field markup
  • Pagination — reusable pager for table/list pages
  • ConfirmDialog — confirmation prompt for destructive actions, built on the existing Modal
  • EmptyState — placeholder for empty lists/tables
  • Toast + ToastProvider/useToast — temporary notifications, wired into the root App layout

Demonstration: integrated FormField and Toast into the existing SMTP Settings page (AP-010) as a live example — all fields now use FormField, and save/test-email results surface via toast instead of inline banners. Behaviour is unchanged, verified locally against Mailpit.

Note: this branch is cut off pratigya245/feature/admin-smtp-config, so it includes the AP-010 password-validation fix from #464 (still pending review). Once #464 merges into main, this diff will narrow to just the AP-019 component-library changes.
toastexample
Clicking Save triggers a small notification that pops up in the top-right corner of the screen, stays visible for about 3 seconds, then disappears automatically — nothing changes in the form layout itself.

@Krisha190235

Copy link
Copy Markdown
Collaborator

Really clean component library — FormField, Toast, Pagination, EmptyState, ConfirmDialog are well-scoped and documented, and I like that you proved it on a real page (SMTP) rather than in isolation. SMTP logic still matches the backend (requires host/port/user/pass/from, sends full settings) 👍

One thing before merge: this overlaps with #464 — both rewrite SMTPSettings.jsx from the same base, so they'll conflict. Since #498 is basically #464 rebuilt on the new shared components, I'd suggest we land #498 and close #464 (or rebase #464 out). Let's not merge both.

Small non-blockers: the toasts could use role="status" / aria-live="polite" so screen readers announce them; and ConfirmDialog/EmptyState/Pagination aren't used yet (fine as library scaffolding). Could you also drop a screenshot or two of the toast + form states as evidence?

Otherwise LGTM once we've sorted the #464 overlap

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