Skip to content

style: put each tag attribute on its own line in Citry UI quality scenarios and component templates - #350

Merged
JuroOravec merged 1 commit into
mainfrom
chore/citry-ui-template-layout-quality
Oct 24, 2026
Merged

JuroOravec merged 1 commit into
mainfrom
chore/citry-ui-template-layout-quality

Conversation

@JuroOravec

Copy link
Copy Markdown
Member

Part of #141: quality scenarios and component runtime templates. This is the second of three PRs. #345 covers the snippets, and the :on* handler PR follows once both are merged.

What changes

The same script as #345 rewrote 268 tags: 180 in quality scenarios and 88 in component runtime templates, which ship in the citry-ui wheel. It changes only whitespace inside start tags. Four # ruff: noqa: E501 lines that are no longer needed are removed.

Proof that rendering is unchanged

Every snippet and quality scenario (716 pages) was rendered on origin/main and on this branch. Scenarios load their compiled Vue definitions by URL, so the code can be compared.

  • Markup: byte-identical on all 716 pages, after normalizing:
    • the per-render random ids;
    • the preload links and integrity digests, which are hashes of each definition's content (the reviewer recomputed all 670 and they match the real bundles).
  • Manifests and compiled render code: equal on all pages that load definitions (631), once position-derived ids are replaced. An independent one-to-one id check confirms this.
  • Both PRs together: I also rendered this branch merged with style: put each attribute of a Citry UI snippet tag on its own line #345 against origin/main. Markup, manifests, and render code are all equal there too.
  • Runtime branches no page reaches: the reviewer compiled all 127 template literals in the changed files, before and after, in both plain and prepared mode. They differ only in the source offsets the compiler emits for error messages. The compiler never copies start-tag text into its output, so this whitespace cannot reach the HTML on any path.

Kept compact

  • 37 tags start on a line after another tag, and 2 after text. The script cannot give these their own indent.

  • 13 tags in two templates built from adjacent string literals (ctransfer_list, cform_collection). The script leaves these alone. Those two templates should become single triple-quoted templates in a follow-up, as CLAUDE.md asks.

  • template body has backslash escapes (left untouched) (2): ctransfer_list/ctransfer_list.py, cform_collection/cform_collection.py

  • after another tag on the same line (37): ctree_grid/ctree_grid.py:483, ctree_grid/ctree_grid.py:483, ctree_grid/ctree_grid.py:485, ctree_grid/ctree_grid.py:486, ctree_grid/ctree_grid.py:506, ctree_grid/ctree_grid.py:508, ctree_grid/ctree_grid.py:514, ccascader/ccascader.py:517, ccascader/ccascader.py:519, ccascader/ccascader.py:527, ccascader/ccascader.py:608, ccascader/ccascader.py:651, ccolor_picker/ccolor_picker.py:284, ccolor_picker/ccolor_picker.py:305, ccolor_picker/ccolor_picker.py:306, ccolor_picker/ccolor_picker.py:307, csortable/csortable.py:502, cdate_picker/quality/scenario.py:20, cdate_picker/quality/scenario.py:62, ctree_grid/quality/scenario.py:41, cdate_input/quality/scenario.py:20, cdate_input/quality/scenario.py:60, ccolor_picker/quality/scenario.py:25, ccarousel/quality/scenario.py:17, cpin_input/quality/scenario.py:79, ccalendar/quality/scenario.py:20, ccalendar/quality/scenario.py:68, cdate_range/quality/scenario.py:35, cdate_range/quality/scenario.py:36, cdate_range/quality/scenario.py:37, cdate_range/quality/scenario.py:38, cdate_range/quality/scenario.py:39, cdate_range/quality/scenario.py:44, crating/quality/scenario.py:64, ctime_picker/quality/scenario.py:20, ctime_picker/quality/scenario.py:25, ctime_picker/quality/scenario.py:81

  • follows text on the same line (2): csplitbutton/quality/scenario.py:48, cform_collection/quality/scenario.py:22

Evidence

  • Independent adversarial review with its own stricter scripts, plus a separate prose pass. Its commit-message corrections are applied.
  • packages/py/citry_ui tests pass (3114 passed, not e2e), as do the 28 unit-test files of the changed runtime components, the real docs build guard suite, citry-ui:check-assets, ruff, ruff format, and the validators. The cargo phases are left to PR CI.
  • Wheel size grows by about 1.2 KB compressed, well under the 800 KiB cap.
  • No changelog entry: this is formatting only, and the rendered output does not change.

🤖 Generated with Claude Code

…narios and component templates

Part of #141 (quality scenarios and component runtime templates). As in
the snippet change (08a1f2a, #345), a template tag with more than two
attributes now has one attribute per line when it sat on one line or
had two attributes on one line, with the closing `>` or `/>` on its own
line at the tag's indent. A script rewrote 268 tags (180 in quality
scenarios, 88 in component runtime templates), changing only whitespace
inside start tags; it also drops four `# ruff: noqa: E501` lines that
are no longer needed.

52 tags keep their compact form: 37 start on a line after another tag
and 2 after text, so the script cannot give them their own indent, and
13 sit in two templates built from adjacent string literals
(ctransfer_list, cform_collection), which the script leaves alone and
which should become single triple-quoted templates in a follow-up.

Proof: every snippet and quality scenario (716 pages) was rendered on
origin/main and on this commit, with scenarios loading the compiled Vue
code for each component (its definition) by URL so the code can be
compared. After replacing the per-render random ids, and the preload
links and integrity digests that are hashes of each definition's
content, the page markup is byte-identical on all 716 pages. The JSON
each page embeds to describe its Vue components (the manifest) differs
only in values Citry computes from a tag's position in the template
source; with those replaced by placeholders, and lists compared without
regard to order, the manifests are equal. The compiled Vue render code
of all 631 pages that load definitions is equal with the same
placeholders, and an independent one-to-one id check confirms both.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@JuroOravec
JuroOravec merged commit 0c63121 into main Oct 24, 2026
18 of 24 checks passed
@JuroOravec
JuroOravec deleted the chore/citry-ui-template-layout-quality branch October 24, 2026 22:53
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.

1 participant