[Issue]: Make GST captcha a popup #114
Labels
No labels
bug
claude-failed
claude-pr
claude-queue
claude-working
epic
feature
interactive
portal
triaged
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: shad0w/pelagia-portal#114
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Raised by
Kaushal Pal Singh (kps@pelagiamarine.com, MANAGER) — via portal Report Issue button
Description
The form gets too big when the captcha section is visible, buttons get hidden. Make it a popup. Remember to have a cancel/close button.
Priority
P2 — Medium
Context
/catalogue/vendorsClaude triage
Triage — Issue #114: Make GST captcha a popup
Summary
On
/catalogue/vendors, the Add Vendor dialog contains a GSTIN lookup. When the userclicks Look up, a CAPTCHA block (image + 6-digit input + Verify / New image buttons)
renders inline inside the same modal. This grows the modal vertically; because the
modal (
AdminDialog) has no internal scroll and is vertically centred, the form's footerbuttons (Cancel / Create Vendor) get pushed off-screen and become unreachable. The
reporter asks to move the CAPTCHA into its own popup with a cancel/close button.
This is a usability defect (footer actions become inaccessible), so it is classified as a
bug; the requested remedy is a small presentation change.
Affected code
App/app/(portal)/admin/vendors/vendor-form.tsx— the single file to change.VendorFormFields(lines ~116–251) holds all CAPTCHA state (captchaStep,captchaB64,captchaAnswer,sessionId,gstError,gstSuccess) and thefetchCaptcha()/submitSearch()handlers.captchaStep === "ready"JSX at lines ~186–208 — thisis what needs to move into a popup.
AddVendorButtonandEditVendorButton, both renderedinside
AdminDialog. The catalogue page importsAddVendorButton(
App/app/(portal)/catalogue/vendors/page.tsx:7,78); admin uses both(
admin/vendors/vendors-table.tsx,admin/vendors/[id]/page.tsx).App/components/ui/admin-dialog.tsx— existing modal primitive (fixed overlay,z-50, Escape-to-close, click-outside-to-close, ✕ button). Reusable for the CAPTCHApopup, but note z-index stacking (see open questions).
App/app/api/gst/captcha/route.tsandApp/app/api/gst/route.ts. The GSTmicroservice integration (fetch CAPTCHA, POST gstin+captcha+sessionId) is not touched
— only where the CAPTCHA UI is rendered changes.
Action items
captchaStep === "ready"CAPTCHA block out of the inline form flow andrender it as a popup/dialog overlaid on the vendor form when a lookup is in progress.
reusing
AdminDialog) that closes it without altering the form fields, resettingcaptchaStepback to"idle".submitSearch), New image (callsfetchCaptcha), Enter-to-submit, and theloading/verifying states. On success the popup closes and Name/Address/Pincode populate
plus the success line shows; on error the error message shows.
gstSuccess/gstError) — keepthe success line on the main form after the popup closes; show in-flight errors inside
the popup so the user sees them in context.
resolving the original complaint.
Open questions
AdminDialogatz-50. A CAPTCHApopup reusing
AdminDialogwould sit at the same z-index — acceptable since it rendersafter and covers it, but a slightly higher z-index (or a dedicated lightweight overlay)
would be safer. Default: reuse
AdminDialogwith a CAPTCHA title.(back to idle)? Assumed yes — treat as Cancel.
vendor-form.tsxCAPTCHA flow (tests/unit/vendors-table.test.tsxexists for the table). A new render test mocking
fetchcould assert the popup appears onLook up and closes on Cancel — nice-to-have, not required for acceptance.
Verification
pnpm type-checkandpnpm lint.it cleanly. Optionally an added Vitest/jsdom render test.
Routing rationale: Localized single-file UI relocation with clear acceptance, no DB/auth/payments and no change to the GST integration itself — safely automatable and verifiable by type-check/lint → claude-queue.
Routing:
claude-queue| Type:bug[Claude] Started working on this issue on branch
claude/issue-114.[Claude] Opened PR #115 with a proposed fix. Review and merge it, then create a release tag to deploy.