Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions quilt-sync/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@
<!-- markdownlint-disable MD013 -->
# Changelog

## [v0.18.3-alpha14] - 2026-07-13

### Changed

- The Set-remote dialog now notes that saving will create a new revision of the package (<https://github.com/quiltdata/quilt-rs/pull/767>)

## [v0.18.3-alpha12] - 2026-07-13

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion quilt-sync/src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "quilt-sync"
version = "0.18.3-alpha12"
version = "0.18.3-alpha14"
authors = ["Quilt Data, Inc."]
description = "Cross-platform desktop application for editing Quilt data packages"
documentation = "https://docs.quiltdata.com"
Expand Down
6 changes: 6 additions & 0 deletions quilt-sync/src-tauri/src/commands/package_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ pub struct InstalledPackageData {
/// uses this to switch the remote button from "Change remote" to a
/// read-only "Show remote" view.
pub remote_locked: bool,
/// True when the package has a local commit. Setting a remote only
/// re-commits (creating a new revision) when there is a commit to
/// re-commit, so the UI gates the "creates a new revision" notice on this.
pub has_local_commit: bool,
pub entries: Vec<InstalledPackageEntryData>,
pub has_remote_entries: bool,
pub ignored_count: usize,
Expand Down Expand Up @@ -186,12 +190,14 @@ async fn get_installed_package_data_from_model(
.remote_uri
.as_ref()
.is_some_and(|r| !r.hash.is_empty());
let has_local_commit = lineage.commit.is_some();

Ok(InstalledPackageData {
namespace: namespace.to_string(),
uri: typed_uri,
status: status_str.to_string(),
remote_locked,
has_local_commit,
entries: entries_list,
has_remote_entries,
ignored_count,
Expand Down
12 changes: 11 additions & 1 deletion quilt-sync/src-tauri/src/commands/package_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ pub struct InstalledPackageListItem {
pub namespace: String,
pub status: String,
pub has_changes: bool,
/// True when the package has a local commit. Setting a remote only
/// re-commits (creating a new revision) when there is a commit to
/// re-commit, so the UI gates the "creates a new revision" notice on this.
pub has_local_commit: bool,
pub uri: Option<quilt_uri::S3PackageUri>,
/// Raw `lineage.remote_uri` rendering, kept separate from `uri` so
/// the UI can still surface a misconfigured remote when origin
Expand Down Expand Up @@ -69,12 +73,15 @@ async fn load_package_item(
let namespace = installed_package.namespace.to_string();
let paused_reason = paused_reasons.get(&namespace).cloned();
let lineage = m.get_installed_package_lineage(installed_package).await?;
// Computed before `lineage` is moved by the `into()` below.
let has_local_commit = lineage.commit.is_some();

let Some(remote_uri) = lineage.remote_uri.as_ref() else {
return Ok(InstalledPackageListItem {
namespace,
status: "local".to_string(),
has_changes: false,
has_local_commit,
uri: None,
remote_display: None,
paused_reason,
Expand All @@ -88,6 +95,7 @@ async fn load_package_item(
namespace,
status: "error".to_string(),
has_changes: false,
has_local_commit,
uri: Some(typed_uri),
remote_display: Some(remote_uri.to_string()),
paused_reason,
Expand All @@ -105,6 +113,7 @@ async fn load_package_item(
namespace,
status: upstream_state.to_string(),
has_changes,
has_local_commit,
uri: Some(typed_uri),
remote_display: Some(remote_display),
paused_reason,
Expand Down Expand Up @@ -731,13 +740,14 @@ mod tests {
namespace: "acme/data".to_string(),
status: "paused".to_string(),
has_changes: false,
has_local_commit: false,
uri: None,
remote_display: None,
paused_reason: Some("workflow rejected metadata".to_string()),
};
assert_eq!(
serde_json::to_string(&item).unwrap(),
r#"{"namespace":"acme/data","status":"paused","hasChanges":false,"uri":null,"remoteDisplay":null,"pausedReason":"workflow rejected metadata"}"#
r#"{"namespace":"acme/data","status":"paused","hasChanges":false,"hasLocalCommit":false,"uri":null,"remoteDisplay":null,"pausedReason":"workflow rejected metadata"}"#
);
}
}
6 changes: 6 additions & 0 deletions quilt-sync/ui/assets/css/pages/installed-packages-list.css
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,12 @@
display: block;
}

.set-remote-form .set-remote-notice {
font-weight: 600;
font-size: 0.9rem;
margin: var(--q-ui-size-3) 0 0;
}

.set-remote-form .set-remote-actions {
display: flex;
gap: var(--q-ui-size-2);
Expand Down
11 changes: 10 additions & 1 deletion quilt-sync/ui/src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ pub struct InstalledPackageData {
/// and can't be edited. The toolbar's remote button becomes a read-only
/// "Show remote" view.
pub remote_locked: bool,
/// Package has a local commit. Setting a remote only re-commits (creating
/// a new revision) when there is one, so the Set-remote notice is gated
/// on this.
pub has_local_commit: bool,
pub entries: Vec<EntryData>,
pub has_remote_entries: bool,
pub ignored_count: usize,
Expand Down Expand Up @@ -259,6 +263,10 @@ pub struct PackageItemData {
pub namespace: String,
pub status: String,
pub has_changes: bool,
/// Package has a local commit. Setting a remote only re-commits (creating
/// a new revision) when there is one, so the Set-remote notice is gated
/// on this.
pub has_local_commit: bool,
pub uri: Option<S3PackageUri>,
pub remote_display: Option<String>,
/// The autosync watcher's `Other` pause message for this namespace,
Expand Down Expand Up @@ -900,12 +908,13 @@ mod tests {
#[test]
fn package_item_data_wire_form_is_verbatim() {
let item = serde_json::from_str::<PackageItemData>(
r#"{"namespace":"acme/data","status":"paused","hasChanges":false,"uri":null,"remoteDisplay":null,"pausedReason":"workflow rejected metadata"}"#,
r#"{"namespace":"acme/data","status":"paused","hasChanges":false,"hasLocalCommit":false,"uri":null,"remoteDisplay":null,"pausedReason":"workflow rejected metadata"}"#,
)
.unwrap();
assert_eq!(item.namespace, "acme/data");
assert_eq!(item.status, "paused");
assert!(!item.has_changes);
assert!(!item.has_local_commit);
assert!(item.uri.is_none());
assert!(item.remote_display.is_none());
assert_eq!(
Expand Down
15 changes: 15 additions & 0 deletions quilt-sync/ui/src/components/set_remote_popup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ pub struct SetRemotePopupData {
pub namespace: String,
pub current_host: Option<String>,
pub current_bucket: Option<String>,
pub has_local_commit: bool,
}

#[component]
Expand All @@ -31,6 +32,11 @@ pub fn SetRemotePopup(
/// (see `InstalledPackage::set_remote` in quilt-rs).
#[prop(optional)]
locked: bool,
/// True when the package has a local commit. Setting a remote only
/// re-commits (creating a new revision) when there is a commit to
/// re-commit, so the "creates a new revision" notice shows only then.
#[prop(optional)]
has_local_commit: bool,
notification: RwSignal<Option<Notification>>,
refetch: Trigger,
on_close: impl Fn() + Clone + 'static,
Expand Down Expand Up @@ -353,6 +359,15 @@ pub fn SetRemotePopup(
}}
})}

// Only an editable package that already has a local commit
// re-commits on save (creating a new revision); the locked
// "Show remote" view and a commit-less package create nothing.
{(!locked && has_local_commit).then(|| view! {
<p class="set-remote-notice">
"Setting a remote will create a new revision of the package."
Comment thread
greptile-apps[bot] marked this conversation as resolved.
</p>
})}

<div class="set-remote-actions">
{(!locked).then(|| view! {
<buttons::FormPrimary on_click=on_submit_click disabled=save_disabled>
Expand Down
1 change: 1 addition & 0 deletions quilt-sync/ui/src/pages/installed_package/content.rs
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@ pub(super) fn InstalledPackageContent(
namespace=data.namespace.clone()
current_host=current_host.clone()
current_bucket=current_bucket.clone()
has_local_commit=data.has_local_commit
locked=remote_locked
notification=notification
refetch=refetch
Expand Down
3 changes: 3 additions & 0 deletions quilt-sync/ui/src/pages/installed_packages_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ fn PackagesListContent(
namespace=data.namespace
current_host=data.current_host
current_bucket=data.current_bucket
has_local_commit=data.has_local_commit
notification=notification
refetch=refetch
on_close=move || show_set_remote_popup.set(None)
Expand Down Expand Up @@ -482,6 +483,7 @@ fn build_package_menu(
let ns_for_set_remote = namespace.clone();
let current_host_for_popup = current_host.clone();
let current_bucket_for_popup = current_bucket.clone();
let has_local_commit_for_popup = data.has_local_commit;
let login_href = origin_host.as_ref().map(|host| {
let back_encoded = urlencoding::encode("/installed-packages-list");
format!("/login?host={host}&back={back_encoded}")
Expand Down Expand Up @@ -559,6 +561,7 @@ fn build_package_menu(
namespace: ns_for_set_remote.clone(),
current_host: current_host_for_popup.clone(),
current_bucket: current_bucket_for_popup.clone(),
has_local_commit: has_local_commit_for_popup,
}))
small=true
warning=true
Expand Down