From 41d5f1c0145bada3363aea29b2063323a1b00000 Mon Sep 17 00:00:00 2001 From: Chili Palmer Date: Fri, 7 Aug 2026 15:40:06 +0200 Subject: [PATCH] Preserve sidebar state for blogmarks. --- README.md | 2 +- crates/bds-ui/src/app.rs | 20 +++++++++++++------- specs/script.allium | 3 +++ 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 72c46d2..cea4d5e 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ The project is under active development. Core blogging workflows are broadly ava - Persistent conversational AI with safe Markdown, streamed and cancellable responses, model/session/token tracking, bounded project-aware blog tools, and localized conversation management in the Chat workspace. Allowlisted render tools add persistent native cards, charts, forms, lists, metrics, mind maps, tables, and tabs without executing assistant-provided HTML or JavaScript. - SSH-agent-based SCP or rsync publishing. - Integrated Git workflow for each blog project's current repository, with repository initialization, read-only origin discovery, Git LFS image tracking, status and diffs, branch/file history with bDS2-compatible sync-status colors, commits, cancellable fetch/pull/push, and post-pull filesystem reconciliation; network actions respect airplane mode. -- Site, media, and translation validation plus `ruds://new-post` Blogmark capture and Lua transforms; captures open directly in the post editor as soon as the draft exists, without waiting for on-device semantic indexing, and defer automatic translation until an explicit manual save, which queues one task per still-missing language. Rendering tasks keep long generated URLs compact in progress messages. Publishing never starts automatic translation. bDS2 keeps its separate `bds2://` bookmarklet protocol. +- Site, media, and translation validation plus `ruds://new-post` Blogmark capture and Lua transforms; captures open directly in the post editor as soon as the draft exists without changing the current or restored sidebar state or waiting for on-device semantic indexing, and defer automatic translation until an explicit manual save, which queues one task per still-missing language. Rendering tasks keep long generated URLs compact in progress messages. Publishing never starts automatic translation. bDS2 keeps its separate `bds2://` bookmarklet protocol. RuDS uses no JavaScript application runtime and loads no CSS or JavaScript from CDNs. The preview is served by the Rust application and displayed by the operating-system webview. diff --git a/crates/bds-ui/src/app.rs b/crates/bds-ui/src/app.rs index 16a834e..1b63aec 100644 --- a/crates/bds-ui/src/app.rs +++ b/crates/bds-ui/src/app.rs @@ -3000,8 +3000,6 @@ impl BdsApp { if self.task_manager.status(task_id) == Some(TaskStatus::Cancelled) { return Task::none(); } - self.sidebar_view = SidebarView::Posts; - self.sidebar_visible = true; let tab = Tab { id: post.id, tab_type: TabType::Post, @@ -3021,8 +3019,6 @@ impl BdsApp { for error in result.transform_errors { self.add_output(&error); } - self.sidebar_view = SidebarView::Posts; - self.sidebar_visible = true; let post_id = result.post.id.clone(); let already_open = self .tabs @@ -11140,6 +11136,8 @@ mod tests { app.tabs.clear(); app.active_tab = None; app.post_editors.clear(); + app.sidebar_view = SidebarView::Media; + app.sidebar_visible = false; let task_id = app.task_manager.submit("Importing blogmark"); let _ = app.update(Message::BlogmarkDraftCreated { @@ -11149,6 +11147,14 @@ mod tests { assert_eq!(app.active_tab.as_deref(), Some(created.id.as_str())); assert!(app.post_editors.contains_key(&created.id)); + assert_eq!(app.sidebar_view, SidebarView::Media); + assert!(!app.sidebar_visible); + let persisted = + engine::ui_state::load(app.db.as_ref().unwrap().conn(), &created.project_id) + .unwrap() + .unwrap(); + assert_eq!(persisted.sidebar_view, "media"); + assert!(!persisted.sidebar_visible); assert_eq!( app.task_manager.status(task_id), Some(TaskStatus::Running), @@ -11175,7 +11181,7 @@ mod tests { } #[test] - fn imported_blogmark_activates_posts_and_opens_its_editor() { + fn imported_blogmark_opens_its_editor_without_changing_sidebar_state() { let (db, project, temp) = setup(); ai::save_endpoint( db.conn(), @@ -11220,8 +11226,8 @@ mod tests { }), }); - assert_eq!(app.sidebar_view, SidebarView::Posts); - assert!(app.sidebar_visible); + assert_eq!(app.sidebar_view, SidebarView::Settings); + assert!(!app.sidebar_visible); assert_eq!(app.active_tab.as_deref(), Some(created.id.as_str())); assert!(app.post_editors.contains_key(&created.id)); assert!(app.embedded_preview.is_some()); diff --git a/specs/script.allium b/specs/script.allium index 2c199b5..0780720 100644 --- a/specs/script.allium +++ b/specs/script.allium @@ -376,6 +376,9 @@ rule ExecuteTransform { -- opens that draft in the post editor immediately. Post-created side -- effects that may take longer, including lazy model loading and semantic -- indexing, continue without delaying or replacing the opened editor. + -- Opening or completing the import does not change the sidebar's active + -- view or visibility; those remain in the current or restored project UI + -- session. @guarantee TransformTrigger -- Transform scripts are triggered automatically by blogmark import.