Skip to content

Settings: Autosync first, global-scope warning on commit-default overrides - #759

Merged
fiskus merged 2 commits into
mainfrom
settings-global-override-warning
Jul 10, 2026
Merged

Settings: Autosync first, global-scope warning on commit-default overrides#759
fiskus merged 2 commits into
mainfrom
settings-global-override-warning

Conversation

@fiskus

@fiskus fiskus commented Jul 10, 2026

Copy link
Copy Markdown
Member

Summary

Two small QuiltSync Settings changes, designed from operator review of the enforcement-era settings UX:

  • Autosync now leads the Settings page (above Commit and Push) — it's the more-used section.
  • The "Edit commit defaults" popup warns loudly that its overrides are global. Selecting the "Override" workflow radio or having any Default metadata shows a red notice — "These settings apply to every bucket. Workflow ids and metadata schemas are defined per bucket — a global override can make commits fail in buckets that don't define it." — and the SAVE button switches to the error color while the notice is up. Purely visual: SAVE never gates, and the warning reflects saved state too (a pre-existing override warns on open).

This deliberately adds no validation machinery: with commit-time enforcement, per-field live validation, and resolution diagnostics all merged, a misconfigured global override now fails loudly and attributably at use time — this slice makes the global scope visible at configuration time. The semantically-complete alternative (per-bucket overrides with a selector) stays deferred until someone actually needs per-bucket divergence.

Implementation notes

  • New reactive danger variant for the form buttons (none existed) — CSS mirrors the existing primary/warning variant structure.
  • Trigger logic is a pure function with native tests (override selected / metadata present / whitespace-only metadata / neither).

Testing

4 new native UI tests for the warning trigger; full gate green (fmt, clippy native + wasm with denied warnings, workspace tests, 53 UI tests). Visual behavior (warning placement, red SAVE, section order) verified by the operator in the running app.

Versions

quilt-sync 0.18.3-alpha9; quilt-rs untouched.

Greptile Summary

This PR makes two UX improvements to the QuiltSync Settings page: Autosync is reordered to appear before Commit and Push, and the "Edit commit defaults" popup gains a reactive red warning banner — plus a red Save button — whenever a workflow override or non-empty default metadata is configured, flagging that these settings apply globally across all buckets.

  • Section reorder (settings.rs): a one-line swap puts AutosyncSection before PublishSection.
  • Global-scope warning (publish.rs): a pure show_global_scope_warning helper (override selected OR metadata non-whitespace) drives a Signal::derive-based reactive signal; the warning <p role="alert"> and the Save button's danger prop both derive from this signal. Four native unit tests cover all four branches of the trigger logic.
  • danger button variant (icon.rs, form_primary.rs, button.css): new MaybeProp<bool> prop on IconButton and FormPrimary; in IconButton the primary class is now gated on !danger, so the two variants are mutually exclusive at the class level. The CSS danger rules mirror the existing primary/warning structure with correct disabled-hover and icon-invert coverage. The previous review's stacking concern is fully resolved.

Confidence Score: 5/5

Safe to merge — changes are purely additive UI logic with no mutations to data paths or business logic.

The warning trigger is a pure function covered by four tests. The danger class now structurally replaces primary rather than depending on CSS cascade order, resolving the one concern raised in the prior round. The CSS danger variant faithfully mirrors the existing primary/warning pattern including the disabled-hover and icon-invert rules. The section reorder is a one-line swap with no logic involved. No data flows, persistence, or side effects are altered.

No files require special attention.

Important Files Changed

Filename Overview
quilt-sync/ui/src/pages/settings/publish.rs Adds GLOBAL_SCOPE_WARNING constant, pure show_global_scope_warning helper with 4 unit tests, and a reactive show_warning signal that drives the warning paragraph and the danger state of the Save button; logic is correct.
quilt-sync/ui/src/components/buttons/base/icon.rs Added danger: MaybeProp prop; primary class now gated on !danger, so danger replaces rather than stacks — the class-stacking issue from the prior review is correctly resolved.
quilt-sync/ui/assets/css/components/button.css New .danger variant mirrors .primary/.warning structure (base style + disabled-hover override + icon invert rule); source ordering ensures danger background beats the generic :hover rule for enabled buttons.
quilt-sync/ui/src/components/buttons/form_primary.rs Threads the new danger: MaybeProp through to IconButton; no logic issues.
quilt-sync/ui/src/pages/settings.rs Single-line reorder: AutosyncSection now renders before PublishSection; no logic changes.
quilt-sync/ui/assets/css/pages/settings.css Adds .global-scope-warning — error-coloured box with 12% tinted background and 1px border; straightforward styling addition.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[User opens Edit commit defaults popup] --> B{Current state:\noverride selected OR\nmetadata non-empty?}
    B -- Yes --> C[show_warning = true]
    B -- No --> D[show_warning = false]
    C --> E[Render global-scope-warning paragraph\nrole=alert]
    C --> F[Save button renders with .danger class\nerror red background]
    D --> G[No warning paragraph]
    D --> H[Save button renders with .primary class\nnormal blue background]
    E --> I{User changes radio / metadata}
    G --> I
    I --> B
    F --> J[User clicks Save]
    H --> J
    J --> K[Saves regardless — warning is visual only]
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    A[User opens Edit commit defaults popup] --> B{Current state:\noverride selected OR\nmetadata non-empty?}
    B -- Yes --> C[show_warning = true]
    B -- No --> D[show_warning = false]
    C --> E[Render global-scope-warning paragraph\nrole=alert]
    C --> F[Save button renders with .danger class\nerror red background]
    D --> G[No warning paragraph]
    D --> H[Save button renders with .primary class\nnormal blue background]
    E --> I{User changes radio / metadata}
    G --> I
    I --> B
    F --> J[User clicks Save]
    H --> J
    J --> K[Saves regardless — warning is visual only]
Loading

Reviews (2): Last reviewed commit: "Make danger replace primary at the class..." | Re-trigger Greptile

…rides

Reorder the Settings page so Autosync precedes Commit and Push. In the
'Edit commit defaults' popup, show an error-palette reminder that these
settings are global whenever a workflow override is selected or default
metadata is present, and recolor SAVE with a new .danger button variant.
The warning is purely advisory — SAVE stays functional.
@fiskus
fiskus marked this pull request as ready for review July 10, 2026 13:04
Comment thread quilt-sync/ui/src/components/buttons/form_primary.rs
The error color won only by CSS rule order; now a danger button simply
is not primary, so no future primary-scoped rule can outrank it.
@fiskus

fiskus commented Jul 10, 2026

Copy link
Copy Markdown
Member Author

@greptileai Please re-review and update the confidence score — the primary/danger class stacking is resolved: danger now replaces primary at the class level in IconButton.

@fiskus
fiskus merged commit 9e9ed5c into main Jul 10, 2026
2 checks passed
@fiskus
fiskus deleted the settings-global-override-warning branch July 10, 2026 13: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.

1 participant