Skip to content

feat(native): add SQLite table/row viewer and composer file-mention drop target (PN-FILES) - #458

Merged
rynfar merged 2 commits into
nativefrom
feat/native-files-sqlite-drop
Nov 20, 2026
Merged

rynfar merged 2 commits into
nativefrom
feat/native-files-sqlite-drop

Conversation

@rynfar

@rynfar rynfar commented Nov 20, 2026

Copy link
Copy Markdown
Owner

Closes the final two remaining parity gaps on PN-FILES and flips PN-FILES from partial to done in apps/native/parity/LEDGER.md.

Part of #249

What changed

  1. Read-only SQLite table & paged row viewer (crates/core/src/files/sqlite.rs, crates/app/src/files/{sqlite.rs, binary.rs, preview.rs})

    • Added a pure, I/O-free t3_core::files::sqlite module holding protocol bounds (SQLITE_PAGE_SIZE = 50, SQLITE_MAX_TABLES = 100, SQLITE_MAX_COLUMNS = 50, SQLITE_MAX_CELL_CHARS = 1024), clamped page math, SQL identifier quoting, PRAGMA table_xinfo column filtering (hidden != 1), NULL/INTEGER/REAL/TEXT/BLOB hex summary formatting, and bounded SQL projection builders.
    • Added bundled rusqlite = 0.32 to apps/native/crates/app/Cargo.toml and implemented SqliteDatabaseHandle backed by an RAII 0600 temp file removed on drop, opened with SQLITE_OPEN_READ_ONLY | SQLITE_OPEN_NO_MUTEX and PRAGMA query_only = ON; PRAGMA trusted_schema = OFF; on a background executor.
    • Lists user tables and views with row counts from sqlite_master (excluding sqlite_% internal tables and virtual tables), queries GENERATED ALWAYS AS (...) VIRTUAL/STORED columns via PRAGMA table_xinfo, supports WITHOUT ROWID tables and quoted identifiers, and surfaces clean error messages for corrupt/encrypted databases and >100 tables.
    • Rendered interactive table/view selector tabs, column headers (PK/GEN hints), virtualized horizontally & vertically scrollable 50-row grid, Prev/Next pagination with localized t/t_fmt strings, read-only notice, and Database/Hex mode toggle.
  2. Composer drop target for DraggedFileMention (crates/app/src/composer/view.rs)

    • Wired .drag_over::<DraggedFileMention>(...) visual highlight and .on_drop::<DraggedFileMention>(...) on #composer-card, delegating each dragged path to insert_mention so single- and multi-file drops from the Files explorer match Add to chat insertion while preserving existing draft text, whitespace boundaries, and cursor position, and respecting rewind/disabled/voice-frozen/question guards.
  3. Parity ledger (apps/native/parity/LEDGER.md)

    • Flipped PN-FILES from partial | #249 to done | and documented both additions.

Verification

  • CARGO_INCREMENTAL=0 cargo clippy --workspace --all-targets -- -D warnings: pass (0 warnings)
  • CARGO_INCREMENTAL=0 cargo test -p t3-core: 1,860 unit + 8 conformance passed, 0 failed
  • CARGO_INCREMENTAL=0 cargo test -p t3-client: 163 passed, 0 failed
  • T3_NATIVE_HOME=<tmp> CARGO_INCREMENTAL=0 cargo test -p t3-native -- --test-threads=1: 213 passed, 0 failed (including new unit + GPUI tests for SQLite tables/paging/generated columns/corrupt errors/Hex toggle and composer DraggedFileMention drop handling)
  • CARGO_INCREMENTAL=0 cargo build -p t3-native: pass
  • vp fmt --check apps/native/parity/LEDGER.md: pass
  • node apps/native/scripts/gen-theme.ts --check: pass
  • node apps/native/conformance/generate.ts --check: pass
  • node --test apps/native/parity/sync.test.ts: 47 passed, 0 failed

Built with Antigravity (Gemini).

@rynfar
rynfar merged commit 71528c8 into native Nov 20, 2026
@rynfar
rynfar deleted the feat/native-files-sqlite-drop branch November 20, 2026 05:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant