Commit graph

384 commits

Author SHA1 Message Date
Rohith Gilla
86ec7fa3d2 chore: remove unnecessary 'use client' directives from Electron app 2025-12-18 13:22:28 +05:30
Rohith Gilla
e901eaaaf8 chore: update date 2025-12-18 13:20:02 +05:30
Rohith Gilla
01ceb600a5 chore: update date 2025-12-18 13:19:26 +05:30
Rohith Gilla
a06bcc0f2e style: apply prettier formatting 2025-12-18 12:58:35 +05:30
Rohith Gilla
b5b24c9110 refactor: split add-widget-dialog into smaller modules with useReducer
- Extract state management into add-widget-dialog-reducer.ts
- Extract step components (TypeStep, SourceStep, ConfigStep) into add-widget-steps.tsx
- Replace 22 useState calls with single useReducer for cleaner state management
- Move constants (WIDGET_TYPES, CHART_TYPES, KPI_FORMATS) to reducer file
- Main dialog file reduced from 700+ to 305 lines
2025-12-18 12:58:28 +05:30
Rohith Gilla
0b35eb5c57 fix: remove trailing semicolons before adding LIMIT to preview query 2025-12-18 12:21:15 +05:30
Rohith Gilla
ee763bdd0e fix: stop refresh job on dashboard deletion and integrate AI widget suggestions
- Stop active refresh cron job before removing dashboard from storage
- Integrate AIWidgetSuggestion component into AddWidgetDialog
- Add preview data button to fetch sample data for AI analysis
- Auto-fill widget config fields when user selects an AI suggestion
2025-12-18 12:07:03 +05:30
Rohith Gilla
a918943322 Revert "fix: stop refresh job on dashboard deletion and remove unused component"
This reverts commit a72425d349.
2025-12-18 12:03:59 +05:30
Rohith Gilla
a72425d349 fix: stop refresh job on dashboard deletion and remove unused component
- Stop active refresh cron job before removing dashboard from storage
- Remove unused AIWidgetSuggestion component
2025-12-18 11:59:04 +05:30
Rohith Gilla
441831373f fix: address code review feedback for scheduler and widget dialog
- Return latest run in runScheduledQueryNow by sorting by startedAt desc
- Add error handling to add-widget-dialog submit flow with user feedback
2025-12-18 11:57:23 +05:30
Rohith Gilla
070841a552 Merge branch 'claude/query-scheduling-cron-Yxty6' of https://github.com/Rohithgilla12/data-peek into claude/query-scheduling-cron-Yxty6 2025-12-18 11:51:54 +05:30
Rohith Gilla
54837e953d feat: better dashboard auto-refresh with error handling and multi-window event emission, and ensure atomic scheduled query run storage with a mutex. 2025-12-18 11:51:29 +05:30
Rohith Gilla
1f965e62e1
Update apps/desktop/src/renderer/src/components/scheduled-queries.tsx
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-12-18 11:47:01 +05:30
coderabbitai[bot]
5cc62d58d2
📝 Add docstrings to claude/query-scheduling-cron-Yxty6 (#74)
Docstrings generation was requested by @Rohithgilla12.

* https://github.com/Rohithgilla12/data-peek/pull/72#issuecomment-3668449724

The following files were modified:

* `apps/desktop/src/main/dashboard-service.ts`
* `apps/desktop/src/main/ipc/dashboard-handlers.ts`
* `apps/desktop/src/main/ipc/index.ts`
* `apps/desktop/src/main/ipc/scheduled-queries-handlers.ts`
* `apps/desktop/src/main/scheduler-service.ts`
* `apps/desktop/src/renderer/src/components/app-sidebar.tsx`
* `apps/desktop/src/renderer/src/components/dashboard/add-widget-dialog.tsx`
* `apps/desktop/src/renderer/src/components/dashboard/ai-widget-suggestion.tsx`
* `apps/desktop/src/renderer/src/components/dashboard/dashboard-form-dialog.tsx`
* `apps/desktop/src/renderer/src/components/dashboard/dashboard-grid.tsx`
* `apps/desktop/src/renderer/src/components/dashboard/dashboard-view.tsx`
* `apps/desktop/src/renderer/src/components/dashboard/dashboards.tsx`
* `apps/desktop/src/renderer/src/components/dashboard/refresh-schedule-dialog.tsx`
* `apps/desktop/src/renderer/src/components/dashboard/widget-card.tsx`
* `apps/desktop/src/renderer/src/components/dashboard/widget-chart.tsx`
* `apps/desktop/src/renderer/src/components/dashboard/widget-kpi.tsx`
* `apps/desktop/src/renderer/src/components/dashboard/widget-table.tsx`
* `apps/desktop/src/renderer/src/components/scheduled-queries-dialog.tsx`
* `apps/desktop/src/renderer/src/components/scheduled-queries.tsx`
* `apps/desktop/src/renderer/src/components/scheduled-query-form-dialog.tsx`
* `apps/desktop/src/renderer/src/components/scheduled-query-runs-dialog.tsx`
* `apps/desktop/src/renderer/src/components/ui/card.tsx`

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-12-18 11:01:38 +05:30
Rohith Gilla
0c97331d1c feat: remove saas-metrics-dashboard seed file 2025-12-18 09:56:40 +05:30
Rohith Gilla
bea8167a3a fix: generate IDs for widgets during dashboard import
Widgets imported from JSON were missing id, createdAt, and updatedAt
fields, causing them to be undefined in the stored dashboard.
2025-12-18 08:23:40 +05:30
Rohith Gilla
bfb909bbda feat: add importable SaaS metrics dashboard
Pre-configured dashboard with 10 widgets ready for import:
- 4 KPIs: MRR, Active Users, Total Orgs, Conversion Rate
- 2 Charts: Revenue Trend (area), Organizations by Plan (bar)
- 1 Pie Chart: Revenue by Plan
- 3 Tables: Top Customers, Recent Signups, Recent Activity

Replace YOUR_CONNECTION_ID with your PostgreSQL connection ID after import.
2025-12-17 22:04:22 +05:30
Rohith Gilla
901f36c5b4 feat: add demo SQL queries for dashboard widgets
Add ready-to-use queries for showcasing the dashboard feature:
- KPIs: MRR, active users, total orgs, conversion rate
- Charts: revenue trends, signups, events by type, plan distribution
- Tables: recent signups, top customers, event log

Works with the existing acme_saas_seed.sql database.
2025-12-17 22:01:24 +05:30
Rohith Gilla
80b79d7f4d fix: use local GridLayoutItem type for react-grid-layout v2 compatibility 2025-12-17 21:54:28 +05:30
Rohith Gilla
8a865b512a feat: add widgets!!!! 2025-12-17 08:34:49 +05:30
Rohith Gilla
3ed1de344f feat(scheduler): replace setTimeout with node-cron for reliable scheduling
- Replace setTimeout-based scheduling with node-cron for precise timing
- Add "New Schedule" button to empty state in sidebar
- Add cron expression validation before scheduling
- Remove comment dividers per style preference
2025-12-16 19:58:56 +05:30
Rohith Gilla
3b22a8a4c9 Merge branch 'main' into claude/query-scheduling-cron-Yxty6 2025-12-16 19:11:41 +05:30
Rohith Gilla
505e1a139c chore: release v0.9.0 2025-12-16 18:26:32 +05:30
Rohith Gilla
5b95ddb260
feat(web): add blog with MDX support and centralized notes (#70)
* feat(web): add blog with MDX support and sitemap integration

- Add blog infrastructure using next-mdx-remote for MDX rendering
- Create blog listing page at /blog with terminal-inspired design
- Add dynamic blog post pages at /blog/[slug]
- Convert existing notes to blog posts (AI assistant, performance analyzer)
- Update sitemap to dynamically include blog posts
- Add Blog link to header and footer navigation
- Style blog content with terminal-themed code blocks and typography

* chore: update a few design changes.

* feat: introduce terminal-style headers for blog post cards and update MDX code block circle colors

* feat: Remove two blog posts and an AI implementation note, update blog infrastructure, and add a reading progress component.

* fix: escape MDX-incompatible characters in blog post

Replace `<1000` and `>10000` with plain text to avoid MDX interpreting
them as JSX tags.
2025-12-16 18:10:34 +05:30
Rohith Gilla
e0ede332d1 fix: escape MDX-incompatible characters in blog post
Replace `<1000` and `>10000` with plain text to avoid MDX interpreting
them as JSX tags.
2025-12-16 18:07:59 +05:30
Rohith Gilla
2483a13166 feat: Remove two blog posts and an AI implementation note, update blog infrastructure, and add a reading progress component. 2025-12-16 18:01:22 +05:30
Claude
ac4557c301
feat: add query scheduling with cron-like support
- Add ScheduledQuery and ScheduledQueryRun types to shared package
- Create scheduler service in main process with cron-parser for scheduling
- Add IPC handlers for scheduled queries CRUD operations
- Update preload to expose scheduled queries API
- Create Zustand store for scheduled queries state management
- Add UI components:
  - ScheduledQueriesDialog for listing and managing schedules
  - ScheduledQueryFormDialog for creating/editing schedules
  - ScheduledQueryRunsDialog for viewing run history
  - ScheduledQueries sidebar component
- Support schedule presets (every minute, hourly, daily, etc.) and custom cron
- Include desktop notifications on completion/error
- Store run history with configurable retention
2025-12-16 10:09:32 +00:00
Rohith Gilla
de82bfb3b0 feat: introduce terminal-style headers for blog post cards and update MDX code block circle colors 2025-12-16 14:48:40 +05:30
Rohith Gilla
5708e162f5 chore: update a few design changes. 2025-12-16 13:52:56 +05:30
Claude
d3efa5e0d1
feat(web): add blog with MDX support and sitemap integration
- Add blog infrastructure using next-mdx-remote for MDX rendering
- Create blog listing page at /blog with terminal-inspired design
- Add dynamic blog post pages at /blog/[slug]
- Convert existing notes to blog posts (AI assistant, performance analyzer)
- Update sitemap to dynamically include blog posts
- Add Blog link to header and footer navigation
- Style blog content with terminal-themed code blocks and typography
2025-12-16 07:48:53 +00:00
Rohith Gilla
e525caf777 feat: add performance indicator with auto-generated index suggestions 2025-12-16 12:01:48 +05:30
Rohith Gilla
a610709b80
feat: add query performance indicator (#69)
* feat: add query perf indication

* fix: address code review issues from PR #69

- Fix invalid PostgreSQL identifier truncation (use substring(0,63) instead of appending dots)
- Split long regex patterns to satisfy Prettier line length limits
- Add guard against empty/malformed EXPLAIN plan arrays
- Use @shared/index import for consistency with project conventions
- Add missing uuid dependency to package.json
2025-12-16 11:52:55 +05:30
Rohith Gilla
8d9b533ad4 chore: release v0.8.1 2025-12-15 15:17:11 +05:30
Rohith Gilla
b668e4c0b8
feat: add server-side pagination for table previews (#68)
* feat: add server-side pagination for table previews

- Add page size selector with options (25, 50, 100, 250, 500)
- Persist user's preferred page size in settings
- Add jump-to-page input for quick navigation
- Show "Rows X-Y of Z" instead of "Page X of Y"
- Implement server-side pagination for table preview tabs:
  - Query uses LIMIT/OFFSET instead of loading all rows
  - COUNT query fetches total for pagination UI
  - Page changes trigger re-query with new offset
- Fix stale closure issue by reading fresh state from store

* chore: small fix
2025-12-15 15:15:35 +05:30
Rohith Gilla
ecfd58e542 docs: reorganize README features and add documentation rule
- Reorganize README features into logical categories (Core, AI Assistant,
  Query Editor, Performance Analysis, Data Management, Visualization, UX)
- Add previously undocumented features (Table Designer, JSON Editor,
  Export, Foreign Key Navigation, Benchmark Mode)
- Add rule to CLAUDE.md requiring feature updates across README, docs,
  and web when adding new features
2025-12-15 13:17:27 +05:30
Kelvin Amoaba
ae5f693777
fix: remove backdrop blur from AI panel overlay (#67)
The backdrop-blur effect was making main window content unreadable
when the AI panel was open.
2025-12-15 10:05:55 +05:30
Rohith Gilla
603728a72a chore: small changes 2025-12-12 17:44:56 +05:30
Rohith Gilla
8d9a32d29c
Create sitemap for web and docs (#65)
* feat: add sitemaps for web and docs

- Add sitemap.ts for Next.js web app with 4 pages (/, /download, /privacy, /terms)
- Add sitemap.xml route for TanStack Start docs with all 31 documentation pages
- Configure appropriate priorities and change frequencies for SEO

* fix: use static sitemap for docs instead of dynamic route

- Replace dynamic sitemap.xml.ts route with static public/sitemap.xml
- Add robots.txt for docs site pointing to sitemap
- Add robots.ts for web app with sitemap reference and API exclusion

---------
2025-12-12 16:35:19 +05:30
Rohith Gilla
321a088705 chore: add simpleanalytics 2025-12-12 15:43:22 +05:30
Rohith Gilla
6a19c3ca8f
docs: comprehensive documentation update and theme fixes (#64)
* docs: add MSSQL and SQLite database support documentation

- Add Microsoft SQL Server documentation page
- Add SQLite database support documentation page
- Update database support index with all 4 supported databases
- Add feature comparison table for all databases
- Update meta.json to include new pages

* docs: comprehensive documentation update for v0.7.0 features

- Add AI Assistant feature documentation with BYOK setup guide
- Add SSH Tunnels documentation for secure remote connections
- Add Query Telemetry documentation with benchmark mode
- Add Command Palette documentation
- Add Multi-Window support documentation
- Update features index with new feature categories
- Update keyboard shortcuts with new shortcuts (Cmd+K, Cmd+I, etc.)
- Update settings documentation with query timeout and AI settings
- Update README with SQLite support, SSH tunnels, and latest features
- Update README to reflect macOS code signing (v0.4.0+)

* feat: update marketing website with latest features

- Add Query Telemetry feature with benchmark mode description
- Add SSH Tunnels feature for secure connections
- Update Multi-Database to include SQLite
- Update hero section to mention SQLite support

* docs: add images to feature documentation

- Add AI Assistant screenshots (query generation, chart generation)
- Add Command Palette screenshot
- Add TODO placeholders for telemetry and SSH tunnel screenshots

* fix: docs homepage button and light mode issues

- Update tagline to include all 4 databases (PostgreSQL, MySQL, SQL Server, SQLite)
- Replace hardcoded dark colors with Tailwind theme variables for light/dark mode support
- Fix button hover state to maintain text visibility

* feat: add query telemetry and multi-window images

Docs:
- Add query-telemetry.png to Query Telemetry page
- Add multi-window.png to Multi-Window page
- Add erd.png to ER Diagrams page

Web app:
- Add Query Telemetry screenshot section
- Add Multi-Window screenshot section
- Import AppWindow icon for multi-window section

* fix: use actual app icon on docs homepage

* fix: ensure docs homepage button text is visible

Use inline style for button text color to override theme styles
that were causing the "Read the Docs" text to be invisible on the
cyan background.

* refactor: use lucide-static icons on docs homepage

Replace inline SVG elements with lucide-static imports for cleaner,
more maintainable code. Added Icon helper component to render the
SVG strings with custom classes.

* fix: enable light/dark mode switching in docs

- Remove forcedTheme and hardcoded dark class from RootProvider
- Add separate light theme CSS variables
- Make color-scheme responsive to theme class
- Use CSS variables for grid pattern background
- Add theme-aware navbar background colors

* fix: address CodeRabbit review comments in docs

- Add cross-platform command palette shortcuts in settings
- Use Windows backslash convention for settings path
- Rename "Query plans (EXPLAIN)" to "Query execution plans"
- Fix compound adjective "Floating-point" in sqlite docs
- Replace vague "very large" with specific "10+ GB" sizing
- Add model maintenance note and provider error disclaimer
- Bundle external images locally to avoid URL fragility
- Fix backtick shortcut rendering in multi-window docs
- Remove TODO comment from ssh-tunnels docs

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-12-12 15:28:25 +05:30
Rohith Gilla
c09d243b58
chore: codebase cleanup and DRY refactoring (#63)
* chore: codebase cleanup and DRY refactoring

- Create useCopyToClipboard hook to eliminate duplicate clipboard pattern
- Create getTypeColor utility to consolidate type color logic
- Create usePanelCollapse hook for panel state management
- Create useExecutionPlanResize hook for resize logic with persistence
- Extract connection string parser to dedicated module (206 lines)
- Remove 5 unused AI response types from shared package
- Remove unused dependencies (@ai-sdk/openai-compatible, @ai-sdk/react)
- Remove machine-generated section comments from shared/index.ts

* chore: fix small issue
2025-12-12 15:04:01 +05:30
Rohith Gilla
5311e58c13 fix: add missing @radix-ui/react-visually-hidden dependency
The command.tsx component imports this package but it was not listed
in dependencies, causing production builds to fail.
2025-12-12 13:00:03 +05:30
Rohith Gilla
448fa4895b chore: release v0.8.0 2025-12-12 12:51:38 +05:30
Rohith Gilla
343131efaa
feat: add multi-window support and settings popup (#61)
* feat: add multi-window support with connection sync

- Add WindowManager class to track and manage multiple windows
- Refactor main process to use WindowManager instead of single mainWindow
- Add cascade positioning for new windows (30px offset)
- Update auto-updater to broadcast to all windows
- Add connection sync across windows via IPC broadcast
- Windows share connection list but have independent tabs/state

* feat: add settings popup and menu shortcuts

- Add New Window menu item (Cmd+Shift+N / Ctrl+Shift+N)
- Add Settings menu item with Cmd+, shortcut (macOS standard)
- Add Settings to File menu for Windows/Linux (Ctrl+,)
- Wire up SettingsModal to open from menu via IPC
- Add onOpenSettings and onConnectionsUpdated to preload API

* chore: fix linting issues
2025-12-12 12:44:18 +05:30
Rohith Gilla
63f824d427
feat: add configurable query timeout setting (#60)
* feat: add configurable query timeout setting

Add a global query timeout setting in Settings → Database that applies
to all database connections (PostgreSQL, MySQL, MSSQL).

Changes:
- Add queryTimeoutMs to QueryOptions interface
- PostgreSQL: uses SET statement_timeout
- MySQL: uses SET SESSION max_execution_time
- MSSQL: uses per-request timeout on request object
- Add Database section to Settings page with timeout input (in seconds)
- Pass timeout through IPC from renderer to main process
- Remove per-connection timeout from MSSQL advanced options
- Default: 0 (no timeout) to allow long-running queries

Closes #58

* fix: add input validation for query timeout to prevent injection

- Add type validation (typeof, Number.isFinite) for queryTimeoutMs in all adapters
- Use parameterized set_config() for PostgreSQL instead of string interpolation
- Handle NaN from invalid input in settings modal
- Update preload type definitions with queryTimeoutMs parameter
2025-12-12 12:40:20 +05:30
Rohith Gilla
ca5d3e0e5c
feat: migrate command palette to cmdk library (#59)
* feat: migrate command palette to cmdk library

- Replace custom command palette with cmdk for better UX
- Add nested page navigation (connections, saved queries, appearance)
- Implement smart fuzzy search with acronym and character matching
- Add pin/unpin functionality for saved queries
- Auto-switch to newly added connections
- Cmd+P now opens directly to connection list with add/edit options

* chore: Apply consistent code formatting and quoting conventions across various files.

* chore: delete unwanted
2025-12-12 11:26:57 +05:30
Carlos Meira
33f74695ca
Better Windows titlebar and resize main thread performance fix (#57)
* Better windows titlebar e some performance improvements

* Cleanups

* improvements
2025-12-12 11:25:29 +05:30
Rohith Gilla
a877a79471 chore: add educator license script 2025-12-11 20:17:41 +05:30
Rohith Gilla
256b06b3a1 chore: release v0.7.0 2025-12-11 12:31:44 +05:30
Rohith Gilla
4509ddafc0
feat: simplify SQLite to local file-only support (#56)
* feat: add SQLite database support

Implement SQLite adapter using better-sqlite3 library:
- Create SQLiteAdapter class implementing DatabaseAdapter interface
- Support all database operations: query, queryMultiple, execute, executeTransaction
- Implement schema discovery using SQLite PRAGMAs (table_info, foreign_key_list, index_list)
- Add SQLite type normalization (INTEGER, TEXT, REAL, BLOB affinities)
- Support EXPLAIN QUERY PLAN for query analysis
- Add comprehensive unit tests for SQLite adapter
- Update query-tracker to handle SQLite (synchronous, non-cancellable)
- Enhance AI service with SQLite-specific SQL guidelines

Note: SQLite uses 'main' as the default schema and doesn't support
sequences or custom types - these methods return empty arrays.

* feat: add SQLite to connection dialog UI

- Add SQLiteIcon component to database-icons.tsx
- Add SQLite button to database type selector (now 4-column grid)
- Show SQLite-specific form with only database file path input
- Hide host, port, user, password fields for SQLite
- Disable SSH/SSL options when SQLite is selected
- Update validation to only require database path for SQLite

* feat: add libSQL/Turso adapter for remote SQLite connections

- Add LibSQLAdapter for connecting to Turso and libSQL databases
- Update db-adapter to route libsql mode connections to LibSQLAdapter
- Extend connection dialog UI with libsql mode selection
- Add libsql-client dependency

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* feat: simplify SQLite to local file-only, remove libSQL/Turso temporarily

Remove @libsql/client dependency due to native module bundling issues
with electron-vite. SQLite now only supports local file-based databases.

Changes:
- Remove @libsql/client from package.json
- Delete libsql-adapter.ts
- Update db-adapter.ts to remove libSQL routing
- Simplify connection dialog to only show file path input for SQLite
- Add "coming soon" note for Turso/libSQL support
- Simplify SQLiteMode type to just "local"

Turso/libSQL support will be re-added once native module bundling
issues are resolved.

---------
2025-12-11 12:16:16 +05:30