Skip to content

Responsive field label layout in the default card template (CS-11384)#5527

Open
burieberry wants to merge 13 commits into
mainfrom
cs-11384-stack-edit-labels
Open

Responsive field label layout in the default card template (CS-11384)#5527
burieberry wants to merge 13 commits into
mainfrom
cs-11384-stack-edit-labels

Conversation

@burieberry

@burieberry burieberry commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Summary

Improves how the default isolated/edit template lays out field labels at narrow widths, and reworks the card-info editor.

  • Per-field label wrapping. Horizontal field rows now use flex-wrap instead of a fixed 425px breakpoint: a label stays beside its input until the field's content area would drop below 14rem, then wraps above it. Each field decides from its own available space, so nested fields and edit-format padding are handled automatically. A per-field container query keeps the stacked state in sync with the wrap point — wrapped labels take the full line (no text wrapping inside the label column) and drop the input-alignment padding.
  • Isolated-format label alignment. Isolated fields render text rather than form controls, so the label no longer carries the input-alignment padding there; labels now align with the top of their content.
  • Card-info editor rework. Adds a collapsible "Default Preview" section showing the card type and computed cardInfo fields as atoms, a thumbnail preview with a combined theme/thumbnail editor toggle, and a thumbnail URL picker with clear button and image-selection fallback. The editor adapts its layout below 425px.
  • Reverted: - Semantic <label> wrappers, safely gated. Edit-format fields whose editor is a single form control (primitive, non-computed contains fields) render inside a <label>. Compound and linked editors keep a div — an implicit label association would forward label clicks to their first button (e.g. remove on a linksTo field). Covered by a new integration test.

Screenshots

Note: Please pay attention to before & after of standard field, linked field, compound field for edit and isolated templates, and provide your opinion. I kept the cardInfo section horizontally oriented with some vertical fields, but made it more compact.

A. Edit View (Standard Template):

Before & After:

cs-11384-before-editcs-11384-after-edit-1b

cs-11384-before-edit-2cs-11384-after-edit-2

cs-11384-compound-edit-beforecs-11384-compound-edit-after

B. Isolated View (Standard Template):

Before & After:
iso-before-1cs-11384-after-isolated-1

cs-11384-before-isolated-2cs-11384-after-isolated-2

cs-11384-compound-iso-beforecs-11384-compound-iso-after

@github-actions

github-actions Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Preview deployments

Host Test Results

    1 files  ±0      1 suites  ±0   2h 58m 24s ⏱️ - 3m 7s
3 548 tests ±0  3 533 ✅ ±0  15 💤 ±0  0 ❌ ±0 
3 567 runs  ±0  3 552 ✅ ±0  15 💤 ±0  0 ❌ ±0 

Results for commit 519b497. ± Comparison against earlier commit 2a8bbe8.

Realm Server Test Results

    1 files      1 suites   15m 58s ⏱️
1 875 tests 1 875 ✅ 0 💤 0 ❌
1 954 runs  1 954 ✅ 0 💤 0 ❌

Results for commit f8b5010.

@burieberry
burieberry force-pushed the cs-11384-stack-edit-labels branch from 44c2fc9 to f8b5010 Compare July 16, 2026 21:34
@burieberry burieberry changed the title Make standard template format stack labels under a certain width Responsive field label layout in the default card template (CS-11384) Jul 16, 2026
@burieberry
burieberry marked this pull request as ready for review July 16, 2026 21:37

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f8b501052b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/base/default-templates/isolated-and-edit.gts Outdated
@burieberry
burieberry requested a review from a team July 16, 2026 22:19
@habdelra
habdelra requested a review from Copilot July 16, 2026 22:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

Comment thread packages/base/default-templates/isolated-and-edit.gts Outdated
burieberry and others added 13 commits July 17, 2026 17:40
The default edit template renders top-level fields with FieldContainer's
horizontal layout, which reserves a minmax(8rem, 25%) label column and
leaves little room for inputs in narrow stack items. Make the edit
template an inline-size query container and switch the horizontal
FieldContainers to a stacked label-over-input layout below 400px.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…eakpoint

Horizontal fields in the default isolated/edit template now use
flex-wrap: each label stays beside its input until the field's content
area would drop below 14rem, then wraps above it. A per-field container
query zeroes the label's alignment padding exactly when it wraps.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
When a field stacks, the label previously kept its 25% flex-basis, so
multi-word labels text-wrapped inside the narrow label column. The
wrapped-state container query now sets flex-basis: 100% so the label
spans its own line.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Isolated fields render text rather than form controls, so the label's
input-alignment padding pushed it below the content's first line. Zero
that padding in isolated format and top-align the content instead of
centering it.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Only fields whose editor is a single form control (primitive, non-computed contains fields) get a <label> wrapper; compound and linked editors contain buttons that an implicit label association would activate when the label text is clicked. Also tidies isolated-format content outline spacing and thumbnail-toggle margins.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
An implicit label association is only safe when a field's editor is a
single form control, and the primitive-field gate could not guarantee
that (e.g. BooleanField's radio-group editor renders its own labels),
so edit-format field containers render as plain divs again.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The card-info editor's preview toggle now sits in normal flow, so the
extra header top padding and flex-start alignment that cleared its old
absolute position are gone; padding and hr color route through scoped
custom properties like the default card template's.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The thumbnail picker renders clear/select buttons alongside its input,
so its field container stays a plain div like the other edit-format
fields.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The notes footer is a child of .default-card-template--inner, which also
carries the format class, so the direct-child selector matches there.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@burieberry
burieberry force-pushed the cs-11384-stack-edit-labels branch from 2a8bbe8 to 519b497 Compare July 17, 2026 21:41
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.

3 participants