Commit graph

4080 commits

Author SHA1 Message Date
Rohan Verma
354d80bf7a
Merge pull request #923 from mvanhorn/osc/905-catch-error-handling
fix: add error logging to empty catch blocks in useMessagesElectric
2026-03-24 00:14:50 -07:00
Rohan Verma
3776d3d6bc
Merge pull request #922 from mvanhorn/osc/904-console-log-guard
fix: gate console.log calls behind development check
2026-03-24 00:12:44 -07:00
Matt Van Horn
15e9f113e5
fix: add error logging to empty catch blocks in useMessagesElectric
Replaces 4 silent catch blocks with console.warn calls so sync
failures are observable in the browser console. Cleanup catches
at lines 147/155 stay silent since PGlite may already be closed.

Fixes #905
2026-03-23 23:34:17 -07:00
Matt Van Horn
b240057c61
fix: gate console.log calls behind development check
Wraps unguarded console.log statements in use-connectors-electric,
mcp-config-validator, and ElectricProvider behind an IS_DEV guard,
matching the existing pattern in lib/electric/client.ts. Keeps
console.error calls untouched so real errors still surface.

Fixes #904
2026-03-23 23:29:16 -07:00
DESKTOP-RTLN3BA\$punk
3c4bdc12f0 Merge commit '5da2d95d80' into dev 2026-03-23 18:22:00 -07:00
Rohan Verma
c5d740f162
Merge pull request #896 from AnishSarkar22/feat/human-in-the-loop
feat: sensitive actions using HITL & unified indexing pipeline for google connectors
2026-03-23 18:20:45 -07:00
Anish Sarkar
eed792c19a refactor: remove deprecated DeepAgentThinking component and redefine ThinkingStep interface for improved clarity 2026-03-24 02:56:42 +05:30
Anish Sarkar
e587b588c9 refactor: migrate thinking steps handling to new data structure and streamline related components 2026-03-24 02:23:05 +05:30
Anish Sarkar
b8f3f41326 refactor: update dependencies and streamline assistant-ui package usages 2026-03-24 02:22:51 +05:30
CREDO23
8dd539c384 feat: add Zero query endpoint and configure ZERO_QUERY_URL
- Create app/api/zero/query/route.ts — resolves named queries to ZQL
  using handleQueryRequest and mustGetQuery from @rocicorp/zero
- Add ZERO_QUERY_URL to both docker-compose files:
  - dev: http://host.docker.internal:3000 (reaches local Next.js from Docker)
  - prod: http://frontend:3000 (Docker service networking)

Without this endpoint, zero-cache cannot resolve named queries and
no data syncs to the client.
2026-03-23 20:58:42 +02:00
CREDO23
4efb4fab4b fix: make migration 107 idempotent for video_presentations table
Check information_schema before creating table to avoid
DuplicateTableError when table already exists from model metadata.
Original op.create_table preserved exactly, only skipped if exists.
2026-03-23 20:27:09 +02:00
CREDO23
29b9cc814f fix: make migration 104 idempotent with if_not_exists on index creation
The notification composite indexes may already exist from the model's
__table_args__, causing DuplicateTableError on fresh migrations.
2026-03-23 20:22:48 +02:00
CREDO23
7d7d032e78 docs: add database permission requirements for Zero in managed environments
Document that the Postgres user needs REPLICATION and CREATE privileges
for zero-cache. Docker setup handles this automatically (superuser), but
managed databases (RDS, Supabase, etc.) may need explicit grants.
2026-03-23 20:01:06 +02:00
CREDO23
cf21eaacfc fix: critical timestamp parsing and audit fixes
- Fix timestamp conversion: String(epochMs) → new Date(epochMs).toISOString()
  in use-messages-sync, use-comments-sync, use-documents, use-inbox.
  Without this, date comparisons (isEdited, cutoff filters) would fail.
- Fix updated_at: undefined → null in use-inbox to match InboxItem type
- Fix ZeroProvider: skip Zero connection for unauthenticated users
- Clean 30+ stale "Electric SQL" comments in backend Python code
2026-03-23 19:49:28 +02:00
CREDO23
f04ab89418 refactor: rename Electric hooks and clean consumer components
Rename hooks to remove Electric branding:
- use-connectors-electric → use-connectors-sync (useConnectorsSync)
- use-messages-electric → use-messages-sync (useMessagesSync)
- use-comments-electric → use-comments-sync (useCommentsSync)

Clean all Electric/PGlite references in consumer components:
connector-popup.tsx, thread.tsx, page.tsx, use-indexing-connectors.ts,
use-connector-dialog.ts
2026-03-23 19:29:08 +02:00
CREDO23
a02bc54e40 feat: rewrite use-inbox and use-documents hooks from Electric to Zero
use-inbox: Keep all API calls (initial load, pagination, unread counts,
markAsRead/markAllAsRead optimistic updates). Replace Electric
sync+PGlite with Zero useQuery. Category filtering in JS. 458 → 273 lines.

use-documents: Keep all API calls (initial load, pagination, type counts,
user enrichment). Replace Electric sync+PGlite with Zero useQuery.
Remove baseline dedup. 511 → 361 lines.

All 7 Electric hooks are now rewritten to use Zero.
2026-03-23 19:21:20 +02:00
CREDO23
833fbb2a76 feat: rewrite use-documents hook from Electric to Zero
Keep all API calls (initial load, pagination, type counts, user
enrichment). Replace Electric sync+PGlite with Zero useQuery for
real-time deltas. Remove baseline dedup. 511 → 361 lines.
2026-03-23 19:16:38 +02:00
CREDO23
cd9d8ca991 feat: rewrite use-comments-electric hook from Electric to Zero
Replace PGlite sync+live query+stream subscriber with Zero useQuery.
All transformation logic preserved exactly: nested comments, mention
rendering, permissions, React Query cache writes. 414 → 207 lines.
2026-03-23 19:08:17 +02:00
CREDO23
5dd101b203 feat: rewrite use-documents-processing hook from Electric to Zero
Replace PGlite aggregate SQL (SUM/CASE) with Zero useQuery + client-side
status counting. State machine (idle/processing/success/error) preserved
exactly. 167 → 79 lines.
2026-03-23 19:06:32 +02:00
CREDO23
c60d2f071c feat: rewrite use-connectors-electric hook from Electric to Zero
Replace PGlite sync+live query with Zero useQuery. Maps camelCase
to snake_case for SearchSourceConnector type. 217 → 44 lines.
2026-03-23 19:04:51 +02:00
CREDO23
5ad25d10ea feat: rewrite use-messages-electric hook from Electric to Zero
Replace PGlite sync+live query with Zero useQuery. Maps camelCase
output to snake_case to preserve consumer contract. 162 → 38 lines.
2026-03-23 19:00:20 +02:00
CREDO23
b27061e44a feat: rewrite use-chat-session-state hook from Electric to Zero
Replace @electric-sql/react useShape with @rocicorp/zero/react useQuery.
Same Jotai atom update, same logic, same consumer contract.
2026-03-23 18:56:32 +02:00
CREDO23
6ad5ead320 docs: add Zero sync documentation and update existing docs
- Create how-to/zero-sync.mdx setup guide
- Update docker-compose.mdx with zero-cache service, env vars, troubleshooting
- Update dev-compose.mdx with Zero build arg
- Update install-script.mdx with zero-cache URL
- Update manual-installation.mdx with Zero frontend env var
- Add Zero sync page to how-to index, meta.json, and sitemap
2026-03-23 18:35:39 +02:00
CREDO23
f29a3edcab chore: update postgresql.conf and contracts comments for Zero
- Replace Electric SQL references in postgresql.conf with Zero-cache
- Clean Electric SQL comments in chat-comments.types.ts and chat-messages.types.ts
2026-03-23 18:30:49 +02:00
CREDO23
f9ba7e52d9 feat: add Zero infra — docker-compose, env vars, Dockerfile, CI workflows
- Add zero-cache service to docker-compose.yml and docker-compose.dev.yml
- Add ZERO_* env vars to docker/.env.example
- Add NEXT_PUBLIC_ZERO_CACHE_URL to surfsense_web/.env.example
- Add NEXT_PUBLIC_ZERO_CACHE_URL placeholder ARG/ENV to Dockerfile
- Add NEXT_PUBLIC_ZERO_CACHE_URL runtime substitution to docker-entrypoint.js
- Add NEXT_PUBLIC_ZERO_CACHE_URL build arg to docker-build.yml and desktop-release.yml
2026-03-23 18:27:18 +02:00
CREDO23
61610106f4 feat: add zero-cache service to production docker-compose
- Add rocicorp/zero:0.26.2 service with Postgres connection,
  SQLite replica volume, healthcheck, and admin password
- Add NEXT_PUBLIC_ZERO_CACHE_URL to frontend env vars
- Frontend now depends on zero-cache health
2026-03-23 18:19:37 +02:00
CREDO23
6143a91406 feat: add ZeroProvider and wire into app layout
- Create components/providers/ZeroProvider.tsx with schema, queries,
  userID, context, and cacheURL configuration
- Wire ZeroProvider into app/layout.tsx wrapping GlobalLoadingProvider
  inside ReactQueryClientProvider (same position ElectricProvider had)
2026-03-23 18:09:59 +02:00
CREDO23
da8f90bfe2 feat: add Zero queries for all 6 synced tables
Define named queries matching each Electric hook's data needs:
- notifications.byUser (use-inbox)
- documents.bySpace (use-documents, use-documents-processing)
- connectors.bySpace (use-connectors-electric)
- messages.byThread (use-messages-electric)
- comments.byThread (use-comments-electric)
- chatSession.byThread (use-chat-session-state)

Also moves schema files from zero/tables/ to zero/schema/ for
consistent modular folder structure.
2026-03-23 17:54:43 +02:00
CREDO23
af2bd744fb feat: add Zero schema with 6 table definitions and relationships
- Create zero/tables/inbox.ts (notifications)
- Create zero/tables/documents.ts (documents, search_source_connectors)
- Create zero/tables/chat.ts (new_chat_messages, chat_comments, chat_session_state)
- Create zero/schema.ts (combines tables, defines relationships, exports zql)
- Consolidate Zero type augmentations into types/zero.d.ts
2026-03-23 17:44:05 +02:00
CREDO23
8298aad2d7 feat: add @rocicorp/zero package and auth context type
- Install @rocicorp/zero@0.26.2 (replaces 4 @electric-sql/* packages)
- Add types/zero-auth.d.ts with Context type for Zero's permission system
2026-03-23 17:23:49 +02:00
CREDO23
2b7465cdaa chore: remove Electric SQL plumbing and infrastructure
Remove all Electric SQL client code, Docker service, env vars, CI build
args, install scripts, and documentation. Feature hooks that depend on
Electric are intentionally left in place to be rewritten with Rocicorp
Zero in subsequent commits.

Deleted:
- lib/electric/ (client.ts, context.ts, auth.ts, baseline.ts)
- ElectricProvider.tsx
- docker/scripts/init-electric-user.sh
- content/docs/how-to/electric-sql.mdx

Cleaned:
- package.json (4 @electric-sql/* deps)
- app/layout.tsx, UserDropdown.tsx, LayoutDataProvider.tsx
- docker-compose.yml, docker-compose.dev.yml
- Dockerfile, docker-entrypoint.js
- .env.example (frontend, docker, backend)
- CI workflows, install scripts, docs
2026-03-23 16:53:20 +02:00
CREDO23
dea0651a94 fix(desktop): include tray icon in packaged app resources 2026-03-23 15:49:50 +02:00
Rohan Verma
5da2d95d80
Merge pull request #901 from MODSetter/dev
Update video link in README.md
2026-03-22 18:21:45 -07:00
Rohan Verma
af5215fa44
Update video link in README.md 2026-03-22 18:20:47 -07:00
Anish Sarkar
009e89e5cd refactor: simplify audio component by removing dropdown menu and integrating download button directly 2026-03-23 03:39:08 +05:30
Anish Sarkar
fed3a3b436 feat: add dropdown menu for audio actions and improve layout in audio component 2026-03-23 03:11:19 +05:30
Anish Sarkar
74ef4bb414 refactor: enhance loading skeleton UI in GenerateReport 2026-03-23 02:55:35 +05:30
Anish Sarkar
3cee59e024 fix: update save shortcut to use cmd/ctrl+Shift+S for saving in PlateEditor and FixedToolbarButtons 2026-03-22 23:06:18 +05:30
Anish Sarkar
2c7908f733 fix: update placeholder texts in Thread component 2026-03-22 22:48:07 +05:30
Anish Sarkar
8510a76e9a refactor: enhance UI for podcast card and audio components 2026-03-22 21:20:05 +05:30
Anish Sarkar
3cef7ef87c chore: update comments in .env.example 2026-03-22 20:33:01 +05:30
Anish Sarkar
0fd03709c6 feat: add internal metadata keys and clean metadata in document formatting 2026-03-22 20:19:42 +05:30
Anish Sarkar
64a83f7ccc refactor: update checkbox classes in DocumentsTableShell to use 'shrink-0' for consistent styling 2026-03-22 19:53:57 +05:30
Rohan Verma
06eaac7cad
Merge pull request #900 from MODSetter/dev
style: update GitHub stars badge appearance with improved spacing and…
2026-03-22 03:17:27 -07:00
DESKTOP-RTLN3BA\$punk
de17ef7f44 style: update GitHub stars badge appearance with improved spacing and color adjustments 2026-03-22 03:17:05 -07:00
Anish Sarkar
5c598e8588 Merge remote-tracking branch 'upstream/dev' into feat/human-in-the-loop 2026-03-22 15:45:45 +05:30
Rohan Verma
e956de109a
Merge pull request #899 from MODSetter/dev
fixes for deployment
2026-03-22 01:57:18 -07:00
DESKTOP-RTLN3BA\$punk
9b8fc10211 Merge commit '1013586506' into dev 2026-03-22 01:56:33 -07:00
DESKTOP-RTLN3BA\$punk
43c9a09a6c chore: add daytona dependency to pyproject.toml and update uv.lock 2026-03-22 01:55:56 -07:00
DESKTOP-RTLN3BA\$punk
0cd596b91f refactor: update video presentation status enum creation to use SQL execution for better handling of duplicates 2026-03-22 01:41:15 -07:00