Conversation
0065paula
force-pushed
the
feat/complex-form-enter-submit
branch
from
September 18, 2026 08:14
b9264f2 to
079894a
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Enter from a field of a form with two or more setting options no longer submits it: submission has to come from the submit button (Tab to it and press Enter, or click it). Single-field forms and widgets that own Enter (comboboxes, array entry editors, textareas) keep their behavior.
Tailwind resolves a bare `shadow-[var(--token)]` as a shadow *colour*, so every button focus ring and the push-button/card/menu elevation shadows were silently dropped, leaving keyboard focus invisible (focus-visible:outline-none left a transparent outline) — the Card hit this earlier and documented it. - Use the unambiguous property form (`[box-shadow:var(--token)]`, or `shadow-[shadow:var(--token)]` where a ring composes with the shadow) for all 29 occurrences. - Buttons, tabs, checkbox, segmented control and auth buttons now follow the design system's button/checkbox spec for focus-visible: 2px outline, 2px offset, stroke-outstanding-base (stroke-serious-base for Danger).
`shadow-[var(--token)]` is read by Tailwind as a shadow *colour*, so the element renders no box-shadow at all — which is how the button focus ring silently disappeared. Card documented the trap in a comment; 29 other places still hit it, so guard it mechanically: - tools/check-shadow-utilities.cjs scans src/ (comment lines excluded) and points at [box-shadow:var(--token)] / shadow-[shadow:var(--token)] - runs in the pre-commit hook, and in CI through `yarn lint:ci` - noted in contributing/architecture.md conventions
0065paula
force-pushed
the
feat/complex-form-enter-submit
branch
from
September 18, 2026 08:31
079894a to
6cb8457
Compare
Codecov flagged the new lines in the form hosts, the drawer chip and the guard itself as uncovered. Cover them where the behaviour lives: - the guard treats a select as a field control and ignores non-element targets - the API key dialog and the playground function dialog submit from the button and refuse Enter inside a field - the trace drawer renders its formatted/raw switch for a formattable body
Contributor
|
Thanks for the review. Please address the following points:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Enter inside a field no longer submits a form with two or more setting options; submission comes from the submit button (Tab to it and press Enter, or click it). Single-field forms and widgets that own Enter (comboboxes, array entry editors, textareas) keep their behaviour.
Two prerequisites surfaced while doing this:
shadow-[var(…)]as a shadow colour, so the focus ring and the push-button/card/menu shadows were never rendered (29 places);Changes
foundation/lib/enter-submit.ts+foundation/hooks/use-form-enter-submit-guard.ts, wired intoResourceForm,CreateApiKeyForm,ApiKeyLimitsCardandFunctionDialog. Complexity is counted from thedata-form-optionmarkersFormFieldGrouprenders, so a single-field form (Workspace) keeps native Enter-to-submit. A composing Enter is left to the input method and only its follow-up submit is refused.stroke-outstanding-base(stroke-serious-basefor Danger) on button-like controls; form fields keep theeffect-outline-active-focushalo. All 29 ambiguous shadow utilities were switched to[box-shadow:var(…)], orshadow-[shadow:var(…)]where the shadow composes withring-*.tools/check-shadow-utilities.cjsrejects the ambiguous syntax; it runs in the pre-commit hook and fromyarn lint:ci, which CI already executes.Verification
yarn typecheck,yarn dep-check,yarn knip, biome, both i18n gates and the new shadow check pass.defaultPrevented), and a composing Enter whose follow-up submit is refused. The only local failures are the pre-existingTimestamp.render.test.tsxtimezone cases (they also fail onmainoutside UTC).ArrowDown+ Enter still selects in a combobox; CTA/Ordinary focus showsoutline: 2px solid rgb(0,128,255)withoutline-offset: 2pxand the button shadow restored; input halo unchanged.Notes