mirror of
https://github.com/narrrl/proton-drive-linux.git
synced 2026-11-03 16:41:26 +01:00
feat(core,gui): split Sync into views, tidy Activity, rework Computers
The Sync page gets Overview, Folders and History views under a switcher in the header. Overview holds the status card, conflicts, transfers and the queue; Folders holds the folder list, with Add Folder and a popover that explains the sync modes; History is the former Activity page, which leaves the sidebar. A banner in Folders and History points back to Overview when changes fail or conflict. Activity hides save-by-rename temporaries (pdfs-core gains syncignore::is_scratch_name), with a toggle to show them again. Runs of similar events fold into one expandable row, "Show Older" pages further back through what the daemon keeps, and titles and details are translated sentences built from the daemon's targets instead of its raw text. Conflict copies say when they were made. Computers lists every device in one group, this computer first with a "This computer" pill; its row opens Sync's folder list. Another computer's row browses its backup read-only in the shared file list, and its menu offers Browse Files, Restore, Rename, "Continue This Backup Here…" (the old identity adoption, now explained in its dialog) and Remove. Subtitles read "last backup" or "no backups yet", and an empty list links to the download page. DirEntry derives Default for the browse view's synthesized entries. The sidebar shows badges for sync problems and waiting invitations, polled every five minutes away from their pages. All catalogs are updated and complete.
This commit is contained in:
1 parent
127b71efd0
commit
da7ea0ec56
22 files changed
+11984
-5767
No files matched your search
@@ -1093,7 +1093,7 @@ pub struct TransferItem {
|
||||
}
|
||||
|
||||
/// One entry in a [`Request::ListDir`] listing.
|
||||
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq)]
|
||||
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Default)]
|
||||
pub struct DirEntry {
|
||||
/// Decrypted node name.
|
||||
pub name: String,
|
||||
|
||||
@@ -96,6 +96,26 @@ pub fn is_transient_name(name: &str) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
/// Whether `name` is scratch another program writes and throws away: the
|
||||
/// [`is_transient_name`] set, plus the save-by-rename temporaries of GTK, Qt,
|
||||
/// Chromium and Electron, generic `.tmp` files and Emacs lock files. None of
|
||||
/// them is a file the user made, so a front-end can hide them from a history
|
||||
/// of what happened to the user's files.
|
||||
pub fn is_scratch_name(name: &str) -> bool {
|
||||
if is_transient_name(name) {
|
||||
return true;
|
||||
}
|
||||
let lower = name.to_ascii_lowercase();
|
||||
lower.ends_with(".tmp")
|
||||
|| lower.ends_with(".temp")
|
||||
|| name.starts_with(".goutputstream-")
|
||||
|| name.starts_with(".org.chromium.")
|
||||
|| name.starts_with(".com.google.chrome.")
|
||||
|| name.starts_with(".#")
|
||||
|| (name.starts_with('#') && name.ends_with('#') && name.len() > 1)
|
||||
|| (name.starts_with('.') && name.contains(".tmp."))
|
||||
}
|
||||
|
||||
/// Filenames accepted as a folder's ignore file, in precedence order.
|
||||
const IGNORE_FILE_NAMES: &[&str] = &[".pdfsignore", ".protonignore"];
|
||||
|
||||
@@ -341,6 +361,25 @@ mod tests {
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn save_by_rename_temporaries_are_scratch() {
|
||||
for name in [
|
||||
".goutputstream-4XK2B2",
|
||||
".org.chromium.Chromium.aBc123",
|
||||
"~$report.docx",
|
||||
".~lock.budget.ods#",
|
||||
".#notes.org",
|
||||
"#notes.org#",
|
||||
"cache.tmp",
|
||||
"page.html.crdownload",
|
||||
] {
|
||||
assert!(is_scratch_name(name), "{name}");
|
||||
}
|
||||
for name in ["report.docx", "notes.org", "#1 hits.txt", ".bashrc"] {
|
||||
assert!(!is_scratch_name(name), "{name}");
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn finished_names_are_not_transient() {
|
||||
for name in [
|
||||
|
||||
Reference in new issue
Block a user