[Issue]: On new PO screen Vendors should have search #109
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#109
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
Similar to items, vendors should also have a search that searches through names and codes
Priority
P2 — Medium
Context
/dashboardClaude triage
Triage — Issue #109: On new PO screen Vendors should have search
Raised by: Kaushal Pal Singh (kps@pelagiamarine.com, MANAGER)
Priority: P2 — Medium
Type: Feature (enhancement to existing UI behaviour)
Routing: claude-queue
Interpretation
On the new-PO screen the Vendor field is a plain native
<select>dropdown with nosearch — the user must scroll the full vendor list. Items, by contrast, use a search-driven
autocomplete. The request is to give Vendor the same searchable behaviour, matching against
both the vendor name and the vendor code (
vendorId).The good news: unlike items (which hit
/api/products/search), the vendor list is alreadyloaded client-side and passed into the form as a
vendorsprop. So the search can be apure client-side filter on the in-memory list — no new API route, no DB work, no schema
migration.
Action items
<select>with a searchable combobox inapp/(portal)/po/new/new-po-form.tsx(lines ~225–246, the "Vendor (optional…)" section).vendorsarray case-insensitively bynameandvendorId(the formal code). Preserve current behaviour: optional field, a "No vendor selected"
empty option, and the existing label format
"{name} (CODE)"/"(unverified)".name="vendorId"input so the server action is unchanged.(a) generalize the existing
components/ui/searchable-select.tsxto accept a genericoption list (it is currently typed to
AccountGroup/ code+name groups), or(b) add a small dedicated vendor combobox component mirroring its look/behaviour
(trigger button + search input + filtered list, portal-rendered, close-on-outside-click).
the experience matches (see open question on scope):
app/(portal)/po/[id]/edit/edit-po-form.tsxapp/(portal)/approvals/[id]/manager-edit-po-form.tsxcase-insensitive, empty-query shows all, "No vendor selected" still selectable).
pnpm type-check,pnpm lint,pnpm test.Files / areas involved
app/(portal)/po/new/new-po-form.tsx— primary target (the issue's "new PO screen").app/(portal)/po/[id]/edit/edit-po-form.tsx,app/(portal)/approvals/[id]/manager-edit-po-form.tsx— same vendor select pattern (consistency).components/ui/searchable-select.tsx— existing reusable combobox to reuse/generalize.components/po/po-line-items-editor.tsx— reference for the item-search UX being mirrored.prisma/schema.prisma):Vendor.name+Vendor.vendorId(the code) — read-only reference, no migration.tests/unit/— new/updated test for the vendor filter.Open questions (non-blocking; safe defaults exist)
to the edit + manager-edit forms for consistency (low risk, same pattern). Reviewer can
trim if they want new-PO only.
SearchableSelectis currently account-code specific. Defaultto a small dedicated vendor combobox (or a light generalization) rather than overloading the
account type — implementer's discretion.
vendorId(the formal verified code shown in the label).Unverified vendors have a null code, so they remain findable by name only.
Why claude-queue
Localized client-side UI change with a clear acceptance criterion ("search by name and code"),
an existing in-repo pattern to mirror, and verifiable via type-check / lint / unit tests. It
touches no DB migrations, auth/permissions, payments, or external systems, and needs no new
API (vendor list is already client-side). It is not a large multi-file feature.
Routing rationale: A localized, client-side searchable-dropdown enhancement with clear acceptance and existing patterns, verifiable by type-check/lint/unit tests and touching no DB/auth/payments/external systems → claude-queue.
Routing:
claude-queue| Type:feature[Claude] Started working on this issue on branch
claude/issue-109.[Claude] Opened PR #110 with a proposed fix. Review and merge it, then create a release tag to deploy.