anitnilay20 / anitnilay20/thoth

SQL query editor UI for file viewer

Ouverte
#149 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
feature size:medium ux
Langage dominant
Rust
Étoiles
70
Forks
5
Merge moyen
10 h 33 min
PR mergées (30 j)
2

Description

## Context

UI layer for the DuckDB file query engine epic (#147). Depends on #148 (FileQueryEngine). Surfaces DuckDB's query capabilities to the user without requiring them to know SQL syntax upfront.

## What to build

A query bar that appears below the file viewer toolbar when a file is open. Two modes — toggled by a button:

**Raw mode** (default): existing lazy scroll behaviour, file-loader plugin drives the view.

**Query mode**: user types SQL, hits Run (or ⌘↵), results render via `dataset-bus` → `data-view`.

### Layout

```
┌─────────────────────────────────────────────────────────┐
│ [Raw ↔ Query] SELECT * FROM data WHERE price > 100 │
│ ORDER BY created_at DESC [Run] │
├─────────────────────────────────────────────────────────┤
│ ┌──────────┬──────────┬──────────────┐ │
│ │ name │ price │ created_at │ │
│ ├──────────┼──────────┼──────────────┤ │
│ │ Widget A │ 149.99 │ 2026-07-01 │ │
│ └──────────┴──────────┴──────────────┘ │
│ 42 rows · 12ms │
└─────────────────────────────────────────────────────────┘
```

### Details

- Query input: multi-line `TextEdit`, monospace font, reasonable min-height
- Run shortcut: ⌘↵ (macOS) / Ctrl+↵
- Status line: row count + execution time, or error message in red
- Results: published to `dataset-bus`, rendered via existing `data-view` node — no new table widget needed
- Column schema from `FileQueryEngine::schema()` available for future autocomplete
- Query persists per tab across mode switches (don't clear when toggling back to raw)
- Default query pre-filled as `SELECT * FROM data LIMIT 1000` on first open

## Acceptance criteria

- [ ] Mode toggle button in file viewer toolbar
- [ ] SQL input with ⌘↵ / Ctrl+↵ run shortcut
- [ ] Results render through existing data-view (no new table implementation)
- [ ] Row count and query time shown in status line
- [ ] Errors shown inline below the editor (not a modal)
- [ ] Query string preserved when switching back to raw mode
- [ ] Works for all formats supported by FileQueryEngine

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.