Skip to content

ui-react: focus goes to the trust heading after a successful save although the opener returns #4434

Open

Description

@schlessera

Out of scope

Changing trust publication, receipt handling, or general Settings focus behavior.

Context

Parent epic: #3597. Follow-up from the final triage of review round 3 of #4425 at 60e9d32f6. This is deferred follow-up work, with no release commitment.

After a proved save, settle calls close(), then setRead(null), then await load() (settle, packages/ui-react/src/components/settings/trust-settings-section.tsx:192-205, lines 200-202). close sets restoreFocus (close, packages/ui-react/src/components/settings/trust-settings-section.tsx:144), and the layout effect restores focus as soon as the draft is gone (useLayoutEffect, packages/ui-react/src/components/settings/trust-settings-section.tsx:129-137, line 136). With read cleared the list, and its Add and Edit controls, are not rendered, so the opener is disconnected when restoration runs and focus goes to the heading even after a create or edit where the same Add or Edit control returns on reload. T04 checks Cancel, which leaves the opener mounted, and does not cover this transition (T04, packages/ui-react/tests/browser/hit-reach.trust-settings.pointer.tsx:197).

Scope

Restore keyboard focus after the proved-save reload using the returning action control when it exists.

Acceptance criteria

  • After a proved create, focus returns to Add; after a proved edit, focus returns to the returning Edit control.
  • After removal or a failed reload, focus goes to the trust heading.
  • A real-browser keyboard test covers all these outcomes.

Verification

Run the keyboard cases in a real browser, with failing-first proof and a mutation that restores premature heading focus.

Contract impact

None; focus behavior only.

2026-11-23 triage at main a3395c4: repaired the drifted line citations by named anchor (the originals pointed at the #4425 review head). Replaced non-manifest type: bug with type: fix; changed priority: p3 to priority: p2, because this restores promised keyboard focus behaviour and needs no further driving use case, matching sibling #4436.

Activity

  1. added
    area: ui-react
    priority: p3
    on Nov 21, 2026
  2. added
    type: fix
    priority: p2
    agent-ready
    and removed
    priority: p3
    on Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-readyarea: ui-reactpriority: p2type: fix

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions