Skip to content

Workflow selector: 'Open in catalog' links for the config and schemas - #756

Merged
fiskus merged 7 commits into
mainfrom
workflow-selector-links
Jul 10, 2026
Merged

Workflow selector: 'Open in catalog' links for the config and schemas#756
fiskus merged 7 commits into
mainfrom
workflow-selector-links

Conversation

@fiskus

@fiskus fiskus commented Jul 9, 2026

Copy link
Copy Markdown
Member

Summary

Small UI follow-up to the workflow-support effort: the workflow selector (commit dialog and Set-remote popup) now shows a helper row under the dropdown —

Open in catalog: config.yml ↗, metadata schema ↗, entries schema ↗

  • config.yml links to the bucket's workflows config; the schema links appear only when the selected workflow declares them and update with the selection ("None" shows just the config link; ungoverned buckets show no row).
  • Links are catalog object URLs formatted backend-side with the existing on-demand catalog-link machinery; schemas resolve to their own bucket/key, so cross-bucket schema references link correctly. Host-less remotes render no links rather than broken ones.
  • Clicking opens the system browser via the existing open-in-browser command; the dialog stays open.
  • quilt-rs gains a small public accessor, WorkflowsConfig::schema_uris, exposing the previously crate-private schema-URL resolution (behavior-preserving refactor of the existing helper).

Testing

Unit tests for the accessor (both/one/none/unknown-id, misconfigured schemas section); backend catalog-link formatting incl. the cross-bucket case; selection-reactivity and view-model tests on the UI side; wire-form tests extended byte-identically on both sides of the Tauri boundary. Full gate green (fmt, clippy native + wasm with denied warnings, tests, rumdl).

Versions

quilt-rs 0.33.0-alpha7, quilt-sync 0.18.3-alpha7.

Greptile Summary

This PR adds "Open in catalog" links to the workflow selector in the commit and Set-remote dialogs. Links are pre-formatted backend-side using the existing catalog-link machinery and cover the bucket's config.yml, plus the selected workflow's declared metadata and entries schemas (updating reactively with the selection).

  • quilt-rs gains a new public WORKFLOWS_CONFIG_KEY constant (replacing three inline string literals), a WorkflowSchemaUris struct, and a schema_uris accessor that resolves independently per schema key — a dangling or missing schema reference degrades that key to None without suppressing the other.
  • quilt-sync's backend extends CommitWorkflowInfo and CommitWorkflows::Available/Invalid with pre-formatted catalog HTTPS URLs; the UI side renders them in a reactive hint row that recomputes as the selection changes.
  • All three Tauri-boundary wire-form tests are updated byte-identically on both sides, and new unit tests cover every resolution path (both/one/none/unknown, independent degradation, cross-bucket schemas, host-less no-op).

Confidence Score: 5/5

Safe to merge — all changes are additive, the new public accessor is lenient by design and cannot affect any existing gate path, and the wire-form extensions are backward-compatible on both ends.

The refactor of resolve_schema_url into a synchronous declared_schema_url is behavior-preserving and now covered by dedicated tests. Schema resolution is independent per key — a dangling reference degrades only that one link, never the other. The WORKFLOWS_CONFIG_KEY constant replaces three separate string literals without changing any behavior. Backend URL formatting reuses the existing display_for_host machinery with proper None-propagation for hostless remotes. The Tauri boundary wire form is verified byte-identically on both sides. No existing functionality is altered; all new surface area has unit test coverage.

No files require special attention.

Important Files Changed

Filename Overview
quilt-rs/src/io/remote/workflow.rs Adds WORKFLOWS_CONFIG_KEY constant, WorkflowSchemaUris struct, and schema_uris accessor; refactors resolve_schema_url to delegate to new synchronous declared_schema_url; thorough tests for all resolution paths.
quilt-sync/src-tauri/src/commands/commit_data.rs Extends CommitWorkflowInfo and CommitWorkflows with pre-formatted catalog URLs; adds catalog_object_url / config_object_url helpers; updates workflows_config_to_commit_workflows and get_bucket_workflows_from_model; comprehensive backend tests including cross-bucket schema and hostless cases.
quilt-sync/ui/src/components/workflow_select.rs Adds schema URL fields to WorkflowOption, config_url to WorkflowView, and a reactive links_row closure; new catalog_links / catalog_link_view helpers; all view-model tests updated, new selection-reactivity and invalid-config tests added.
quilt-sync/ui/src/commands.rs Wire-form types updated to match backend extensions; wire-form roundtrip tests updated byte-identically for both new fields.
quilt-sync/ui/assets/css/components/workflow_select.css Adds .qui-workflow-links, .qui-workflow-link, .qui-workflow-link:hover, and .qui-workflow-links-label rules; fixes .qui-workflow-hint margin to zero-out the default bottom margin.
quilt-rs/src/installed_package.rs Replaces two inline .quilt/workflows/config.yml string literals with the new WORKFLOWS_CONFIG_KEY constant; doc comment updated.

Sequence Diagram

%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
    participant UI as workflow_select.rs (UI)
    participant CMD as commands.rs (wire types)
    participant BE as commit_data.rs (backend)
    participant WF as workflow.rs (quilt-rs)

    UI->>CMD: deserialize CommitWorkflows JSON
    note over CMD: Available { workflows, config_url }<br/>Invalid { reason, config_url }

    BE->>WF: fetch_workflows_config_for_bucket()
    WF-->>BE: WorkflowsConfig

    BE->>WF: config.schema_uris(workflow_id)
    note over WF: Reads declared URLs from raw YAML<br/>Each key resolves independently<br/>Errors degrade to None (lenient)
    WF-->>BE: "WorkflowSchemaUris { metadata_schema, entries_schema }"

    BE->>BE: catalog_object_url(uri, host)
    note over BE: Uses S3Uri::display_for_host<br/>None when no catalog host

    BE->>BE: config_object_url(host, bucket)
    note over BE: Shared by Available + Invalid<br/>Uses WORKFLOWS_CONFIG_KEY constant

    BE-->>CMD: "CommitWorkflowInfo { metadata_schema_url, entries_schema_url }<br/>CommitWorkflows::Available { config_url }"
    CMD-->>UI: deserialized structs

    UI->>UI: build_workflow_view()
    note over UI: Threads config_url into WorkflowView<br/>Schema URLs attached per WorkflowOption

    UI->>UI: links_row (reactive closure)
    note over UI: Recomputes on selected signal change<br/>catalog_links(config_url, schema_urls[idx])

    UI->>UI: catalog_link_view(label, url)
    note over UI: on:click -> prevent_default<br/>spawn_local -> open_in_web_browser
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"}}}%%
sequenceDiagram
    participant UI as workflow_select.rs (UI)
    participant CMD as commands.rs (wire types)
    participant BE as commit_data.rs (backend)
    participant WF as workflow.rs (quilt-rs)

    UI->>CMD: deserialize CommitWorkflows JSON
    note over CMD: Available { workflows, config_url }<br/>Invalid { reason, config_url }

    BE->>WF: fetch_workflows_config_for_bucket()
    WF-->>BE: WorkflowsConfig

    BE->>WF: config.schema_uris(workflow_id)
    note over WF: Reads declared URLs from raw YAML<br/>Each key resolves independently<br/>Errors degrade to None (lenient)
    WF-->>BE: "WorkflowSchemaUris { metadata_schema, entries_schema }"

    BE->>BE: catalog_object_url(uri, host)
    note over BE: Uses S3Uri::display_for_host<br/>None when no catalog host

    BE->>BE: config_object_url(host, bucket)
    note over BE: Shared by Available + Invalid<br/>Uses WORKFLOWS_CONFIG_KEY constant

    BE-->>CMD: "CommitWorkflowInfo { metadata_schema_url, entries_schema_url }<br/>CommitWorkflows::Available { config_url }"
    CMD-->>UI: deserialized structs

    UI->>UI: build_workflow_view()
    note over UI: Threads config_url into WorkflowView<br/>Schema URLs attached per WorkflowOption

    UI->>UI: links_row (reactive closure)
    note over UI: Recomputes on selected signal change<br/>catalog_links(config_url, schema_urls[idx])

    UI->>UI: catalog_link_view(label, url)
    note over UI: on:click -> prevent_default<br/>spawn_local -> open_in_web_browser
Loading

Reviews (2): Last reviewed commit: "Drop the oversized comment on the label ..." | Re-trigger Greptile

fiskus added 5 commits July 9, 2026 16:04
- schema_uris resolves each key independently (display-only, infallible);
  a dangling/unknown ref drops only that link
- Invalid state carries a config.yml catalog link, threaded to the UI notice
- bucket is Option<&str> through workflows_config_to_commit_workflows; a
  missing bucket yields no links
- route the previous-revision workflow URL through catalog_object_url
- single WORKFLOWS_CONFIG_KEY const in quilt-rs, used at all four sites
- lighter links-row closure captures projected schema URLs, not full options
- zero-copy move of workflow strings in the commit-data builder
@fiskus
fiskus marked this pull request as ready for review July 10, 2026 09:20
Comment thread quilt-sync/ui/assets/css/components/workflow_select.css
@fiskus

fiskus commented Jul 10, 2026

Copy link
Copy Markdown
Member Author

@greptileai Please re-review and update the confidence score — since your review: the seven verified findings from an external review pass were applied (independent per-key schema resolution, config link on the Invalid notice, Option bucket threading, helper reuse, shared WORKFLOWS_CONFIG_KEY, lighter closure capture, zero-copy mapping), and your CSS finding is resolved with an explicit nowrap rule for the label class.

@fiskus
fiskus merged commit 74d3a1b into main Jul 10, 2026
2 checks passed
@fiskus
fiskus deleted the workflow-selector-links branch July 10, 2026 09:37
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