fix(app): reserved bundled module ids, existing-data warning, clipboard cleared on hide, fields reset per screen

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
dasemuandClaude Opus 5.5 committed 2026-10-26 16:34:25 +01:00
1 parent 0024438706
commit ada391a88e
11 files changed
+404 -95

No files matched your search

+6
View File
@@ -51,6 +51,12 @@ impl SynapseGraph {
Ok(self.modules.call(&id, &req)?.to_string())
}
/// Whether the graph already holds data for module `id` (a module installed under that id
/// can read it; the consent dialog warns about it).
pub fn module_has_data(&self, id: String) -> Result<bool> {
Ok(self.modules.has_data(&id)?)
}
/// Stops a module's running instance (dropping its in-memory state).
pub fn stop_module(&self, id: String) {
self.modules.stop(&id);
+100 -39
View File
@@ -41,7 +41,7 @@ flutter_rust_bridge::frb_generated_boilerplate!(
default_rust_auto_opaque = RustAutoOpaqueMoi,
);
pub(crate) const FLUTTER_RUST_BRIDGE_CODEGEN_VERSION: &str = "2.13.0";
pub(crate) const FLUTTER_RUST_BRIDGE_CODEGEN_CONTENT_HASH: i32 = -821319892;
pub(crate) const FLUTTER_RUST_BRIDGE_CODEGEN_CONTENT_HASH: i32 = -984841087;
// Section: executor
@@ -1960,6 +1960,61 @@ fn wire__crate__api__graph__SynapseGraph_module_call_impl(
},
)
}
fn wire__crate__api__graph__SynapseGraph_module_has_data_impl(
port_: flutter_rust_bridge::for_generated::MessagePort,
ptr_: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr,
rust_vec_len_: i32,
data_len_: i32,
) {
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::SseCodec, _, _>(
flutter_rust_bridge::for_generated::TaskInfo {
debug_name: "SynapseGraph_module_has_data",
port: Some(port_),
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal,
},
move || {
let message = unsafe {
flutter_rust_bridge::for_generated::Dart2RustMessageSse::from_wire(
ptr_,
rust_vec_len_,
data_len_,
)
};
let mut deserializer =
flutter_rust_bridge::for_generated::SseDeserializer::new(message);
let api_that = <RustOpaqueMoi<
flutter_rust_bridge::for_generated::RustAutoOpaqueInner<SynapseGraph>,
>>::sse_decode(&mut deserializer);
let api_id = <String>::sse_decode(&mut deserializer);
deserializer.end();
move |context| {
transform_result_sse::<_, flutter_rust_bridge::for_generated::anyhow::Error>(
(move || {
let mut api_that_guard = None;
let decode_indices_ =
flutter_rust_bridge::for_generated::lockable_compute_decode_order(
vec![flutter_rust_bridge::for_generated::LockableOrderInfo::new(
&api_that, 0, false,
)],
);
for i in decode_indices_ {
match i {
0 => api_that_guard = Some(api_that.lockable_decode_sync_ref()),
_ => unreachable!(),
}
}
let api_that_guard = api_that_guard.unwrap();
let output_ok = crate::api::graph::SynapseGraph::module_has_data(
&*api_that_guard,
api_id,
)?;
std::result::Result::Ok(output_ok)
})(),
)
}
},
)
}
fn wire__crate__api__graph__SynapseGraph_modules_impl(
port_: flutter_rust_bridge::for_generated::MessagePort,
ptr_: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr,
@@ -5119,183 +5174,189 @@ fn pde_ffi_dispatcher_primary_impl(
rust_vec_len,
data_len,
),
36 => wire__crate__api__graph__SynapseGraph_modules_impl(port, ptr, rust_vec_len, data_len),
37 => {
36 => wire__crate__api__graph__SynapseGraph_module_has_data_impl(
port,
ptr,
rust_vec_len,
data_len,
),
37 => wire__crate__api__graph__SynapseGraph_modules_impl(port, ptr, rust_vec_len, data_len),
38 => {
wire__crate__api__graph__SynapseGraph_move_block_impl(port, ptr, rust_vec_len, data_len)
}
38 => wire__crate__api__graph__SynapseGraph_open_impl(port, ptr, rust_vec_len, data_len),
39 => {
39 => wire__crate__api__graph__SynapseGraph_open_impl(port, ptr, rust_vec_len, data_len),
40 => {
wire__crate__api__graph__SynapseGraph_open_page_impl(port, ptr, rust_vec_len, data_len)
}
40 => wire__crate__api__graph__SynapseGraph_outdent_block_impl(
41 => wire__crate__api__graph__SynapseGraph_outdent_block_impl(
port,
ptr,
rust_vec_len,
data_len,
),
41 => wire__crate__api__graph__SynapseGraph_outline_impl(port, ptr, rust_vec_len, data_len),
42 => wire__crate__api__graph__SynapseGraph_page_impl(port, ptr, rust_vec_len, data_len),
43 => wire__crate__api__graph__SynapseGraph_page_by_title_impl(
42 => wire__crate__api__graph__SynapseGraph_outline_impl(port, ptr, rust_vec_len, data_len),
43 => wire__crate__api__graph__SynapseGraph_page_impl(port, ptr, rust_vec_len, data_len),
44 => wire__crate__api__graph__SynapseGraph_page_by_title_impl(
port,
ptr,
rust_vec_len,
data_len,
),
44 => wire__crate__api__graph__SynapseGraph_page_structure_impl(
45 => wire__crate__api__graph__SynapseGraph_page_structure_impl(
port,
ptr,
rust_vec_len,
data_len,
),
45 => wire__crate__api__graph__SynapseGraph_pages_with_tag_impl(
46 => wire__crate__api__graph__SynapseGraph_pages_with_tag_impl(
port,
ptr,
rust_vec_len,
data_len,
),
46 => wire__crate__api__graph__SynapseGraph_purge_pages_impl(
47 => wire__crate__api__graph__SynapseGraph_purge_pages_impl(
port,
ptr,
rust_vec_len,
data_len,
),
47 => wire__crate__api__graph__SynapseGraph_put_asset_bytes_impl(
48 => wire__crate__api__graph__SynapseGraph_put_asset_bytes_impl(
port,
ptr,
rust_vec_len,
data_len,
),
48 => wire__crate__api__graph__SynapseGraph_put_asset_file_impl(
49 => wire__crate__api__graph__SynapseGraph_put_asset_file_impl(
port,
ptr,
rust_vec_len,
data_len,
),
49 => wire__crate__api__graph__SynapseGraph_record_visit_impl(
50 => wire__crate__api__graph__SynapseGraph_record_visit_impl(
port,
ptr,
rust_vec_len,
data_len,
),
50 => wire__crate__api__graph__SynapseGraph_related_impl(port, ptr, rust_vec_len, data_len),
51 => wire__crate__api__graph__SynapseGraph_remove_alias_impl(
51 => wire__crate__api__graph__SynapseGraph_related_impl(port, ptr, rust_vec_len, data_len),
52 => wire__crate__api__graph__SynapseGraph_remove_alias_impl(
port,
ptr,
rust_vec_len,
data_len,
),
52 => wire__crate__api__graph__SynapseGraph_remove_from_hub_impl(
53 => wire__crate__api__graph__SynapseGraph_remove_from_hub_impl(
port,
ptr,
rust_vec_len,
data_len,
),
53 => wire__crate__api__graph__SynapseGraph_remove_page_tag_impl(
54 => wire__crate__api__graph__SynapseGraph_remove_page_tag_impl(
port,
ptr,
rust_vec_len,
data_len,
),
54 => {
55 => {
wire__crate__api__graph__SynapseGraph_remove_tag_impl(port, ptr, rust_vec_len, data_len)
}
55 => wire__crate__api__graph__SynapseGraph_remove_type_impl(
56 => wire__crate__api__graph__SynapseGraph_remove_type_impl(
port,
ptr,
rust_vec_len,
data_len,
),
56 => wire__crate__api__graph__SynapseGraph_rename_page_impl(
57 => wire__crate__api__graph__SynapseGraph_rename_page_impl(
port,
ptr,
rust_vec_len,
data_len,
),
57 => {
58 => {
wire__crate__api__graph__SynapseGraph_rename_tag_impl(port, ptr, rust_vec_len, data_len)
}
58 => wire__crate__api__graph__SynapseGraph_rename_type_impl(
59 => wire__crate__api__graph__SynapseGraph_rename_type_impl(
port,
ptr,
rust_vec_len,
data_len,
),
59 => wire__crate__api__graph__SynapseGraph_search_blocks_impl(
60 => wire__crate__api__graph__SynapseGraph_search_blocks_impl(
port,
ptr,
rust_vec_len,
data_len,
),
60 => wire__crate__api__graph__SynapseGraph_search_titles_impl(
61 => wire__crate__api__graph__SynapseGraph_search_titles_impl(
port,
ptr,
rust_vec_len,
data_len,
),
61 => wire__crate__api__graph__SynapseGraph_set_collapsed_impl(
62 => wire__crate__api__graph__SynapseGraph_set_collapsed_impl(
port,
ptr,
rust_vec_len,
data_len,
),
62 => wire__crate__api__graph__SynapseGraph_set_hub_description_impl(
63 => wire__crate__api__graph__SynapseGraph_set_hub_description_impl(
port,
ptr,
rust_vec_len,
data_len,
),
63 => wire__crate__api__graph__SynapseGraph_set_module_enabled_impl(
64 => wire__crate__api__graph__SynapseGraph_set_module_enabled_impl(
port,
ptr,
rust_vec_len,
data_len,
),
64 => wire__crate__api__graph__SynapseGraph_set_page_tags_impl(
65 => wire__crate__api__graph__SynapseGraph_set_page_tags_impl(
port,
ptr,
rust_vec_len,
data_len,
),
65 => wire__crate__api__graph__SynapseGraph_set_page_type_impl(
66 => wire__crate__api__graph__SynapseGraph_set_page_type_impl(
port,
ptr,
rust_vec_len,
data_len,
),
66 => wire__crate__api__graph__SynapseGraph_set_type_icon_impl(
67 => wire__crate__api__graph__SynapseGraph_set_type_icon_impl(
port,
ptr,
rust_vec_len,
data_len,
),
67 => wire__crate__api__graph__SynapseGraph_stop_module_impl(
68 => wire__crate__api__graph__SynapseGraph_stop_module_impl(
port,
ptr,
rust_vec_len,
data_len,
),
68 => wire__crate__api__graph__SynapseGraph_tag_catalog_impl(
69 => wire__crate__api__graph__SynapseGraph_tag_catalog_impl(
port,
ptr,
rust_vec_len,
data_len,
),
69 => {
70 => {
wire__crate__api__graph__SynapseGraph_timeline_impl(port, ptr, rust_vec_len, data_len)
}
71 => wire__crate__api__graph__SynapseGraph_type_catalog_impl(
72 => wire__crate__api__graph__SynapseGraph_type_catalog_impl(
port,
ptr,
rust_vec_len,
data_len,
),
72 => wire__crate__api__graph__SynapseGraph_uninstall_module_impl(
73 => wire__crate__api__graph__SynapseGraph_uninstall_module_impl(
port,
ptr,
rust_vec_len,
data_len,
),
73 => wire__crate__api__graph__SynapseGraph_update_block_impl(
74 => wire__crate__api__graph__SynapseGraph_update_block_impl(
port,
ptr,
rust_vec_len,
@@ -5316,7 +5377,7 @@ fn pde_ffi_dispatcher_sync_impl(
1 => wire__crate__api__layout__ForceLayout_new_impl(ptr, rust_vec_len, data_len),
10 => wire__crate__api__graph__SynapseGraph_asset_path_impl(ptr, rust_vec_len, data_len),
20 => wire__crate__api__graph__SynapseGraph_dir_impl(ptr, rust_vec_len, data_len),
70 => wire__crate__api__graph__SynapseGraph_today_impl(ptr, rust_vec_len, data_len),
71 => wire__crate__api__graph__SynapseGraph_today_impl(ptr, rust_vec_len, data_len),
_ => unreachable!(),
}
}