Skip to content

Commit 536d564

Browse files
authored
Note in Set-remote that saving creates a new package revision (#767)
1 parent 3e7ed3f commit 536d564

10 files changed

Lines changed: 60 additions & 4 deletions

File tree

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

quilt-sync/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@
99
<!-- markdownlint-disable MD013 -->
1010
# Changelog
1111

12+
## [v0.18.3-alpha14] - 2026-07-13
13+
14+
### Changed
15+
16+
- The Set-remote dialog now notes that saving will create a new revision of the package (<https://github.com/quiltdata/quilt-rs/pull/767>)
17+
1218
## [v0.18.3-alpha12] - 2026-07-13
1319

1420
### Fixed

quilt-sync/src-tauri/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "quilt-sync"
3-
version = "0.18.3-alpha12"
3+
version = "0.18.3-alpha14"
44
authors = ["Quilt Data, Inc."]
55
description = "Cross-platform desktop application for editing Quilt data packages"
66
documentation = "https://docs.quiltdata.com"

quilt-sync/src-tauri/src/commands/package_data.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ pub struct InstalledPackageData {
3232
/// uses this to switch the remote button from "Change remote" to a
3333
/// read-only "Show remote" view.
3434
pub remote_locked: bool,
35+
/// True when the package has a local commit. Setting a remote only
36+
/// re-commits (creating a new revision) when there is a commit to
37+
/// re-commit, so the UI gates the "creates a new revision" notice on this.
38+
pub has_local_commit: bool,
3539
pub entries: Vec<InstalledPackageEntryData>,
3640
pub has_remote_entries: bool,
3741
pub ignored_count: usize,
@@ -186,12 +190,14 @@ async fn get_installed_package_data_from_model(
186190
.remote_uri
187191
.as_ref()
188192
.is_some_and(|r| !r.hash.is_empty());
193+
let has_local_commit = lineage.commit.is_some();
189194

190195
Ok(InstalledPackageData {
191196
namespace: namespace.to_string(),
192197
uri: typed_uri,
193198
status: status_str.to_string(),
194199
remote_locked,
200+
has_local_commit,
195201
entries: entries_list,
196202
has_remote_entries,
197203
ignored_count,

quilt-sync/src-tauri/src/commands/package_list.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ pub struct InstalledPackageListItem {
2424
pub namespace: String,
2525
pub status: String,
2626
pub has_changes: bool,
27+
/// True when the package has a local commit. Setting a remote only
28+
/// re-commits (creating a new revision) when there is a commit to
29+
/// re-commit, so the UI gates the "creates a new revision" notice on this.
30+
pub has_local_commit: bool,
2731
pub uri: Option<quilt_uri::S3PackageUri>,
2832
/// Raw `lineage.remote_uri` rendering, kept separate from `uri` so
2933
/// the UI can still surface a misconfigured remote when origin
@@ -69,12 +73,15 @@ async fn load_package_item(
6973
let namespace = installed_package.namespace.to_string();
7074
let paused_reason = paused_reasons.get(&namespace).cloned();
7175
let lineage = m.get_installed_package_lineage(installed_package).await?;
76+
// Computed before `lineage` is moved by the `into()` below.
77+
let has_local_commit = lineage.commit.is_some();
7278

7379
let Some(remote_uri) = lineage.remote_uri.as_ref() else {
7480
return Ok(InstalledPackageListItem {
7581
namespace,
7682
status: "local".to_string(),
7783
has_changes: false,
84+
has_local_commit,
7885
uri: None,
7986
remote_display: None,
8087
paused_reason,
@@ -88,6 +95,7 @@ async fn load_package_item(
8895
namespace,
8996
status: "error".to_string(),
9097
has_changes: false,
98+
has_local_commit,
9199
uri: Some(typed_uri),
92100
remote_display: Some(remote_uri.to_string()),
93101
paused_reason,
@@ -105,6 +113,7 @@ async fn load_package_item(
105113
namespace,
106114
status: upstream_state.to_string(),
107115
has_changes,
116+
has_local_commit,
108117
uri: Some(typed_uri),
109118
remote_display: Some(remote_display),
110119
paused_reason,
@@ -731,13 +740,14 @@ mod tests {
731740
namespace: "acme/data".to_string(),
732741
status: "paused".to_string(),
733742
has_changes: false,
743+
has_local_commit: false,
734744
uri: None,
735745
remote_display: None,
736746
paused_reason: Some("workflow rejected metadata".to_string()),
737747
};
738748
assert_eq!(
739749
serde_json::to_string(&item).unwrap(),
740-
r#"{"namespace":"acme/data","status":"paused","hasChanges":false,"uri":null,"remoteDisplay":null,"pausedReason":"workflow rejected metadata"}"#
750+
r#"{"namespace":"acme/data","status":"paused","hasChanges":false,"hasLocalCommit":false,"uri":null,"remoteDisplay":null,"pausedReason":"workflow rejected metadata"}"#
741751
);
742752
}
743753
}

quilt-sync/ui/assets/css/pages/installed-packages-list.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,12 @@
150150
display: block;
151151
}
152152

153+
.set-remote-form .set-remote-notice {
154+
font-weight: 600;
155+
font-size: 0.9rem;
156+
margin: var(--q-ui-size-3) 0 0;
157+
}
158+
153159
.set-remote-form .set-remote-actions {
154160
display: flex;
155161
gap: var(--q-ui-size-2);

quilt-sync/ui/src/commands.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ pub struct InstalledPackageData {
1616
/// and can't be edited. The toolbar's remote button becomes a read-only
1717
/// "Show remote" view.
1818
pub remote_locked: bool,
19+
/// Package has a local commit. Setting a remote only re-commits (creating
20+
/// a new revision) when there is one, so the Set-remote notice is gated
21+
/// on this.
22+
pub has_local_commit: bool,
1923
pub entries: Vec<EntryData>,
2024
pub has_remote_entries: bool,
2125
pub ignored_count: usize,
@@ -259,6 +263,10 @@ pub struct PackageItemData {
259263
pub namespace: String,
260264
pub status: String,
261265
pub has_changes: bool,
266+
/// Package has a local commit. Setting a remote only re-commits (creating
267+
/// a new revision) when there is one, so the Set-remote notice is gated
268+
/// on this.
269+
pub has_local_commit: bool,
262270
pub uri: Option<S3PackageUri>,
263271
pub remote_display: Option<String>,
264272
/// The autosync watcher's `Other` pause message for this namespace,
@@ -900,12 +908,13 @@ mod tests {
900908
#[test]
901909
fn package_item_data_wire_form_is_verbatim() {
902910
let item = serde_json::from_str::<PackageItemData>(
903-
r#"{"namespace":"acme/data","status":"paused","hasChanges":false,"uri":null,"remoteDisplay":null,"pausedReason":"workflow rejected metadata"}"#,
911+
r#"{"namespace":"acme/data","status":"paused","hasChanges":false,"hasLocalCommit":false,"uri":null,"remoteDisplay":null,"pausedReason":"workflow rejected metadata"}"#,
904912
)
905913
.unwrap();
906914
assert_eq!(item.namespace, "acme/data");
907915
assert_eq!(item.status, "paused");
908916
assert!(!item.has_changes);
917+
assert!(!item.has_local_commit);
909918
assert!(item.uri.is_none());
910919
assert!(item.remote_display.is_none());
911920
assert_eq!(

quilt-sync/ui/src/components/set_remote_popup.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ pub struct SetRemotePopupData {
1717
pub namespace: String,
1818
pub current_host: Option<String>,
1919
pub current_bucket: Option<String>,
20+
pub has_local_commit: bool,
2021
}
2122

2223
#[component]
@@ -31,6 +32,11 @@ pub fn SetRemotePopup(
3132
/// (see `InstalledPackage::set_remote` in quilt-rs).
3233
#[prop(optional)]
3334
locked: bool,
35+
/// True when the package has a local commit. Setting a remote only
36+
/// re-commits (creating a new revision) when there is a commit to
37+
/// re-commit, so the "creates a new revision" notice shows only then.
38+
#[prop(optional)]
39+
has_local_commit: bool,
3440
notification: RwSignal<Option<Notification>>,
3541
refetch: Trigger,
3642
on_close: impl Fn() + Clone + 'static,
@@ -353,6 +359,15 @@ pub fn SetRemotePopup(
353359
}}
354360
})}
355361

362+
// Only an editable package that already has a local commit
363+
// re-commits on save (creating a new revision); the locked
364+
// "Show remote" view and a commit-less package create nothing.
365+
{(!locked && has_local_commit).then(|| view! {
366+
<p class="set-remote-notice">
367+
"Setting a remote will create a new revision of the package."
368+
</p>
369+
})}
370+
356371
<div class="set-remote-actions">
357372
{(!locked).then(|| view! {
358373
<buttons::FormPrimary on_click=on_submit_click disabled=save_disabled>

quilt-sync/ui/src/pages/installed_package/content.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,7 @@ pub(super) fn InstalledPackageContent(
284284
namespace=data.namespace.clone()
285285
current_host=current_host.clone()
286286
current_bucket=current_bucket.clone()
287+
has_local_commit=data.has_local_commit
287288
locked=remote_locked
288289
notification=notification
289290
refetch=refetch

quilt-sync/ui/src/pages/installed_packages_list.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@ fn PackagesListContent(
251251
namespace=data.namespace
252252
current_host=data.current_host
253253
current_bucket=data.current_bucket
254+
has_local_commit=data.has_local_commit
254255
notification=notification
255256
refetch=refetch
256257
on_close=move || show_set_remote_popup.set(None)
@@ -482,6 +483,7 @@ fn build_package_menu(
482483
let ns_for_set_remote = namespace.clone();
483484
let current_host_for_popup = current_host.clone();
484485
let current_bucket_for_popup = current_bucket.clone();
486+
let has_local_commit_for_popup = data.has_local_commit;
485487
let login_href = origin_host.as_ref().map(|host| {
486488
let back_encoded = urlencoding::encode("/installed-packages-list");
487489
format!("/login?host={host}&back={back_encoded}")
@@ -559,6 +561,7 @@ fn build_package_menu(
559561
namespace: ns_for_set_remote.clone(),
560562
current_host: current_host_for_popup.clone(),
561563
current_bucket: current_bucket_for_popup.clone(),
564+
has_local_commit: has_local_commit_for_popup,
562565
}))
563566
small=true
564567
warning=true

0 commit comments

Comments
 (0)