Skip to content

fix(console): defects and a11y gaps found while writing the E2E suite - #2206

Merged
golanglemonade merged 5 commits into
mainfrom
e2e/split/console-fixes
Aug 29, 2026
Merged

fix(console): defects and a11y gaps found while writing the E2E suite#2206
golanglemonade merged 5 commits into
mainfrom
e2e/split/console-fixes

Conversation

@papistacoding

@papistacoding papistacoding commented Aug 25, 2026

Copy link
Copy Markdown
Member

Defects and a11y gaps I hit while writing the E2E suite. 59 files, but most of that is
aria-label and data-testid additions with no runtime effect. The real changes:

The profile form discarded what you were typing. form.reset() ran on every change
of userData, so any background refetch while the form was open threw the in-progress
edits away. Guarded with a ref plus isDirty, so hydration happens once and never
over a dirty form.

Trust center document sheet — prefill ran on every documentData change rather
than once per document id. Separately, data.standardID != null meant an empty-string
standard was sent as standardID: "" instead of clearing the association.

Procedure tags went stale. The card mirrored form.getValues('tags') into local
state from an effect keyed on form, which never changes identity, so tags set
anywhere else never appeared. Derived from useWatch now.

Trust center updates validated title and text but rendered no message, so
submitting an incomplete update silently did nothing.

Vendors leaked a raw Zod 4 message ("Invalid input: expected string, received
undefined") on an empty name, because the field had no default.

On the a11y side: the onboarding question label pointed at a SelectTrigger with no id,
so clicking it did nothing and screen readers had no association. Clickable divs in the
severity chart and the chip components are real buttons now, so they're
keyboard-reachable. aria-labels on icon-only controls that had no accessible name at
all.

Also pulled the control and evidence input building out into pure functions so the
association-stripping can be tested away from React — two small test files come with
that.

Behaviour changes:
- trust-center/updates: the create and edit forms validated title and
  text but rendered no message, so submitting an incomplete update did
  nothing visible
- vendors: an empty name leaked a raw Zod 4 message ('Invalid input:
  expected string, received undefined') because the field had no default
- onboarding: the question label pointed at a SelectTrigger with no id,
  so clicking it did nothing and screen readers had no association

Accessibility:
- aria-label on five icon-only buttons (trust-center updates and FAQ
  edit/delete/reorder) that had no accessible name at all

Test affordances, no behaviour change:
- data-testid on menu triggers and status fields whose only other handle
  was a CSS class
- Menu gains an optional triggerTestId prop, inert unless passed

Signed-off-by: papistacoding <bruno.papista@gmail.com>
@vercel

vercel Bot commented Aug 25, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
openlane-ui Ready Ready Preview Aug 29, 2026 1:45pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
storybook Ignored Ignored Aug 29, 2026 1:45pm

Request Review

Row-action triggers, bulk-select checkboxes, column-visibility toggles, status
and approval selects, domain-list inputs and several icon-only buttons had no
accessible name, so they could only be reached by CSS class or DOM position.

Adds aria-label / Label htmlFor / inputLabel so they resolve by role and name.
Second batch, disjoint from the set already under review.

Signed-off-by: papistacoding <bruno.papista@gmail.com>
Five defects found by the E2E suite, three of them the same shape: a form reset
driven by query data, which is correct on first load and destructive on every
refetch after it.

- create-document.sheet.tsx: an unset standard was sent as standardID: "",
  which core rejects with a constraint error — so NO trust-center document
  without a standard could be edited at all, silently, with the dialog closing
  as if it had saved. Send clearStandard instead, and omit it on create.
- create-document.sheet.tsx: the prefill effect keyed on documentData, so any
  background refetch reset the form and discarded in-progress edits. Prefill
  once per document id.
- profile-name-form.tsx: same reset pattern. On a slow first load the query
  resolved after the user began typing and wiped the fields; the blanked values
  then failed min-length validation, so Save did nothing and showed no error.
  Hydrate once, and never over a dirty form.
- tags-card.tsx (procedures): tagValues mirrored the form into local state in an
  effect keyed on `form`, a stable ref — so it ran once on mount, before the
  async reset. Tags never rendered on edit. Derive from useWatch instead of
  keeping a second source of truth.
- create-procedure-form.tsx: AuthorityCard received no approver/delegate and the
  reset omitted approverID/delegateID, so a saved approver always redisplayed
  as unset.

Signed-off-by: papistacoding <bruno.papista@gmail.com>
Extract the control and evidence create-input construction into pure
functions so they can be unit tested away from the form, and give the
comment, group-member and status controls the accessible names the suite
needs to address them.

Signed-off-by: papistacoding <bruno.papista@gmail.com>
…ing branch

The objectType 'global' -> null correction is also made in the filters PR,
which additionally moves this file onto defineFilterFields. Keeping one copy
there avoids two PRs claiming the same fix.

Signed-off-by: papistacoding <bruno.papista@gmail.com>
@golanglemonade
golanglemonade merged commit e2737c9 into main Aug 29, 2026
7 checks passed
@golanglemonade
golanglemonade deleted the e2e/split/console-fixes branch August 29, 2026 14:36
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