desktop M10.4: Rust local SQLite store + Tauri commands
Desktop (Tauri) / Tauri desktop (Linux) (push) Failing after 24s
Desktop (Tauri) / Tauri desktop (Linux) (push) Failing after 24s
The on-device core that makes the desktop app work with no server and no login. - rusqlite (bundled SQLite, so no system libsqlite dependency to vary across builds); uuid v4 ids; RFC3339/Date.toISOString-compatible timestamps. - Schema mirroring the note model: notes, labels, note_labels (with via_tag), checklist_items, attachments, link_previews, note_revisions, saved_filters, plus per-row sync_revision/dirty + a sync_state row for the M10.7 engine. user_version-gated migrations. - derive.rs: pure [[wiki-link]] + #tag scanners (mirror the frontend inline rules, no regex dep) with unit tests; #tags re-sync via_tag labels on save, [[links]] drive backlinks at query time (derived, never stored). - store.rs: the full repository surface (facet/label/date/text list, create, PATCH-semantics update, pin/archive/color/kind, checklist items, labels CRUD + merge, reminders complete/snooze, reorder, trash/restore/delete, revisions + restore, titles/search/backlinks/link-search, saved filters). - commands.rs: ~38 #[tauri::command]s over a Mutex<Connection> in managed state. - lib.rs: opens the DB in the platform app-data dir on setup; synthetic offline config/user so the auth-gated router resolves with no login. Attachment upload / URL unfurl / import are intentionally deferred (network/file concerns); adapters/local.ts (M10.5) wires all of the above via invoke. Task 1993. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FRgehjoz7Yv8LkUfADxACm
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
//! AppImage) and boots the UI.
|
||||
|
||||
mod integration;
|
||||
mod local;
|
||||
|
||||
#[cfg_attr(mobile, tauri::mobile_entry_point)]
|
||||
pub fn run() {
|
||||
@@ -14,10 +15,56 @@ pub fn run() {
|
||||
harden_linux_webkit_rendering();
|
||||
|
||||
tauri::Builder::default()
|
||||
.setup(|app| {
|
||||
use tauri::Manager;
|
||||
// The on-device store lives in the platform app-data dir (e.g. Linux
|
||||
// ~/.local/share/com.fabledsword.thoughtsync/thoughtsync.db), created on
|
||||
// first launch. This is what makes the app work with no server or login.
|
||||
let dir = app.path().app_data_dir()?;
|
||||
std::fs::create_dir_all(&dir)?;
|
||||
app.manage(local::open(&dir.join("thoughtsync.db"))?);
|
||||
Ok(())
|
||||
})
|
||||
.invoke_handler(tauri::generate_handler![
|
||||
integration::integration_status,
|
||||
integration::integrate_desktop,
|
||||
integration::unintegrate_desktop,
|
||||
local::commands::config_get,
|
||||
local::commands::auth_me,
|
||||
local::commands::notes_list,
|
||||
local::commands::notes_get,
|
||||
local::commands::notes_create,
|
||||
local::commands::notes_create_titled,
|
||||
local::commands::notes_update,
|
||||
local::commands::notes_complete_reminder,
|
||||
local::commands::notes_snooze_reminder,
|
||||
local::commands::notes_set_labels,
|
||||
local::commands::notes_add_item,
|
||||
local::commands::notes_update_item,
|
||||
local::commands::notes_delete_item,
|
||||
local::commands::notes_delete_attachment,
|
||||
local::commands::notes_delete_preview,
|
||||
local::commands::notes_reorder,
|
||||
local::commands::notes_trash,
|
||||
local::commands::notes_restore,
|
||||
local::commands::notes_delete_forever,
|
||||
local::commands::notes_revisions,
|
||||
local::commands::notes_restore_revision,
|
||||
local::commands::notes_reminders,
|
||||
local::commands::notes_titles,
|
||||
local::commands::notes_search,
|
||||
local::commands::notes_backlinks,
|
||||
local::commands::notes_link_search,
|
||||
local::commands::labels_list,
|
||||
local::commands::labels_create,
|
||||
local::commands::labels_rename,
|
||||
local::commands::labels_set_color,
|
||||
local::commands::labels_remove,
|
||||
local::commands::labels_merge,
|
||||
local::commands::saved_filters_list,
|
||||
local::commands::saved_filters_create,
|
||||
local::commands::saved_filters_remove,
|
||||
local::commands::saved_filters_rename,
|
||||
])
|
||||
.run(tauri::generate_context!())
|
||||
.expect("error while running the ThoughtSync desktop app");
|
||||
|
||||
Reference in New Issue
Block a user