GUI Application
The project includes a native desktop GUI built with egui/eframe, an immediate-mode GUI framework for Rust.
Launch
cargo run --bin convert_to_parquet_gui
The gui Cargo feature (enabling eframe, rfd, egui_extras) is a default feature, so a plain build/run enables it; on a build with --no-default-features, pass --features gui explicitly. The binary is declared in Cargo.toml as convert_to_parquet_gui, with its entry point at src/bin/gui_convert.rs; the GUI modules live under src/gui/.
Features
| Feature | Description |
|---|---|
| File drag-and-drop | Drag input files onto the window, or use the file/folder picker (rfd) |
| Schema editing | Inspect and modify inferred column types/names before conversion |
| Column renaming (Parquet) | For Parquet inputs, rename columns in place via parquet_rewrite::rename_parquet_columns |
| Data preview | View a sample of the data before committing to conversion |
| JSON flatten options | Toggle --flatten / separator / max-level per file, same as the CLI |
| Batch conversion | Queue multiple files and convert them in one operation, capped by memory-aware concurrency (memory::max_concurrent_jobs) |
| Overwrite guards | Warns when an output file already exists; lets you confirm |
| Export format selection | Choose output format(s): Parquet, CSV, JSONL, JSON, and/or XLSX (multiple at once) |
Architecture
The GUI follows a model-view separation pattern:
┌────────────────────────────────────────────────────────────┐
│ convert_to_parquet_gui │
│ src/bin/gui_convert.rs (entry point → gui::run()) │
├────────────────────────────────────────────────────────────┤
│ src/gui/ │
│ ├── mod.rs ── Module wiring │
│ ├── app.rs ── ConverterApp state, egui App impl │
│ ├── model.rs ── UI state types (FileOptions, │
│ │ OutputSelection, EditableField, ...) │
│ ├── worker.rs ── Background analysis/conversion │
│ │ threads (mpsc channel) │
│ ├── analysis.rs ── Input format detection │
│ ├── paths.rs ── Output path resolution │
│ ├── theme.rs ── egui theme setup │
│ └── view/ │
│ ├── mod.rs ── Menu bar, sidebar, outputs panel, │
│ │ overwrite modal │
│ ├── detail.rs ── Per-file detail tabs (data/schema/ │
│ │ options/validation/parquet stats) │
│ └── preview.rs ── Data preview tab rendering │
└────────────────────────────────────────────────────────────┘
Model-View Separation
- Model (
model.rs): data structures holding UI state — loaded files (FileEntry), per-file options (FileOptions, column edits), requested outputs (OutputSelection), job state (JobState). - View (
view/): panels render the model and pushUiActions back toapp.rs, which mutates state and forwards work toworker.rs.
Background Worker Threads
Long-running analysis and conversions run on background worker threads (src/gui/worker.rs) to keep the UI responsive:
- Each queued file is analyzed (
spawn_analysis) and, once started, converted (spawn_conversion) on its ownstd::thread::spawnthread. - Concurrency is capped at
memory::max_concurrent_jobs()(memory-budget-aware); queued jobs beyond the cap wait inJobState::Queueduntil a slot frees up. - Workers send
WorkerMsg(Analyzed,Progress,ProgressBytes,Done,Failed) back to the UI thread through anmpscchannel. - The UI polls the channel each frame and updates per-file progress and results.
This design prevents the UI from freezing during large file conversions and bounds total memory use across concurrent jobs.
Usage Walkthrough
- Launch the application with
cargo run --bin convert_to_parquet_gui - Add files by dragging them onto the window or using the file picker
- Review schema for each file — adjust column types if needed
- Select output format from the drop-down (Parquet, CSV, JSONL, JSON, XLSX)
- Set output directory and confirm overwrite behaviour
- Click Convert — progress bars show per-file status
- View results in the results panel after completion
Key Source Files
| File | Purpose |
|---|---|
src/bin/gui_convert.rs | Entry point for the convert_to_parquet_gui binary |
src/gui/app.rs | ConverterApp state, egui App trait implementation, job scheduling |
src/gui/model.rs | UI state types: FileOptions, OutputSelection, EditableField, JobState, DetailTab |
src/gui/worker.rs | Background analysis/conversion threads, WorkerMsg channel |
src/gui/analysis.rs | Input format detection for a dropped/picked file |
src/gui/paths.rs | Output path resolution (per-file and per-sheet) |
src/gui/theme.rs | egui visual theme setup |
src/gui/view/mod.rs | Menu bar, sidebar, output-format panel, overwrite confirmation modal |
src/gui/view/detail.rs | Per-file detail tabs: data preview, schema editor, options, validation, Parquet stats |
src/gui/view/preview.rs | Tabular data preview rendering |