secrets manager
git clone https://git.lucas.co/cce-secrets.git
cce-secrets: "Loading entries…" is progress, not a status that ends a sync
The reload's opening line cleared the syncing flag, so the "N entries"
that followed still flashed before the result. A Progress message shows
only when no sync is in flight and never clears the flag; errors stay
Status.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
src/main.rs | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/src/main.rs b/src/main.rs
index 86b9cfa..81c3027 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -71,6 +71,9 @@ enum Cmd {
enum AppMessage {
Loaded(Vec<EntryData>),
Status(String, bool),
+ /// A transient progress line ("Loading entries…"): shown unless a sync
+ /// is in flight, and never the end of one.
+ Progress(String),
Revealed { path: String, secret: String },
SelectPath(String),
RefreshClicked,
@@ -283,7 +286,7 @@ async fn run_secret_op(
}
async fn load_entries(ss: &SecretService<'_>, tx: &calloop::channel::Sender<AppMessage>) {
- let _ = tx.send(AppMessage::Status("Loading entries…".to_string(), false));
+ let _ = tx.send(AppMessage::Progress("Loading entries…".to_string()));
let collections = match ss.get_all_collections().await {
Ok(c) => c,
Err(e) => {
@@ -805,6 +808,12 @@ impl Application for SecretsApp {
self.status_msg = msg;
self.status_is_error = is_error;
}
+ AppMessage::Progress(msg) => {
+ if !self.syncing {
+ self.status_msg = msg;
+ self.status_is_error = false;
+ }
+ }
AppMessage::Revealed { path, secret } => {
if self.selected.as_deref() == Some(path.as_str()) {
self.revealed = Some((path, secret));