Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
0b6a4fb
saving
RickyDane May 16, 2026
3c363e7
docs: add design spec for soft & elevated popup overhaul
RickyDane May 16, 2026
57874af
feat(ui): complete overhaul of popup system and settings UI to Soft &…
RickyDane May 16, 2026
6ae5792
Revert "feat(ui): complete overhaul of popup system and settings UI t…
RickyDane May 16, 2026
2cf9d7c
saving commit
RickyDane May 16, 2026
a11706c
feat(ui): redesign file explorer popups and actions
RickyDane May 17, 2026
857a828
feat(ui): refine settings and theme overlays
RickyDane May 17, 2026
fb4ef17
feat(ui): modernize header searchbar
RickyDane May 17, 2026
258cf28
fix(ui): cap size calculations
RickyDane May 17, 2026
ac6da85
saving commit
RickyDane May 18, 2026
8e2d0b6
saving commit
RickyDane May 18, 2026
86866a9
saving commit
RickyDane May 18, 2026
9882a54
saving commit
RickyDane May 18, 2026
ebc8de0
saving commit
RickyDane May 18, 2026
a8e344b
saving commit
RickyDane May 19, 2026
f627d8f
saving commit
RickyDane May 19, 2026
73ee50d
image upscaling + edit
RickyDane May 19, 2026
8a6a9f1
added/refined ai image upscaling
RickyDane May 19, 2026
78d061f
docs: add design spec for image background removal
RickyDane May 20, 2026
cbe5d16
feat(backend): add remove_background command
RickyDane May 20, 2026
d9bdb5e
feat(ui): add Remove Background tab and UI elements
RickyDane May 20, 2026
190ee7f
feat(ui): implement tab switching logic for Background Removal
RickyDane May 20, 2026
b8963d7
feat(ui): implement background removal execution logic
RickyDane May 20, 2026
b767d28
perf(backend): deduplicate AI logic and add safety checks
RickyDane May 20, 2026
eccfb86
fix(ui): prevent layout shift when switching back to upscale tab
RickyDane May 20, 2026
5e96230
saving commit
RickyDane May 22, 2026
14f98ed
saving commit
RickyDane May 22, 2026
575b0fd
saving commit
RickyDane May 22, 2026
d2c24b3
saving commit
RickyDane May 22, 2026
95ae214
ftp
RickyDane May 22, 2026
0a698cc
feat: redesign FTP Connection modal layout and integrate macOS keychain
RickyDane May 23, 2026
750c436
perf: optimize Cargo.toml profiles, offload blocking backend file/sea…
RickyDane May 23, 2026
0477e74
style: redesign multi-rename modal into props-card with 2-column inpu…
RickyDane May 23, 2026
53f54bf
feat(ftp): fix copy progress stuck at 100%, search deadlocks, dropdow…
RickyDane May 23, 2026
2f11ece
feat: progress modal reopening and premium spinner styling
RickyDane May 23, 2026
4d3c2d0
refactor: complete Tauri v2.0 migration, drag-and-drop fixes, and lay…
RickyDane May 23, 2026
1d8edbd
feat: implement system clipboard integration & native PNG screenshot …
RickyDane May 23, 2026
72d728a
feat: implement AI Folder Organizer with premium responsive layout an…
RickyDane May 23, 2026
d07ef69
saving commit
RickyDane May 23, 2026
b2192f4
saving commit
RickyDane May 23, 2026
5e962b0
saving commit
RickyDane May 23, 2026
a63e8ec
fix: resolve Linux and Windows build/CI failures
RickyDane May 24, 2026
6c831bd
saving commit
RickyDane May 24, 2026
33f68af
fix: import Getter trait and fix HGLOBAL raw pointer cast on Windows
RickyDane May 24, 2026
c70929d
fix(ftp): resolve remote multi-folder sizes calculation and auto-relo…
RickyDane May 24, 2026
8b6e47e
chore: resolve cargo unused import and unexpected_cfgs warnings
RickyDane May 24, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
if: matrix.settings.platform == 'ubuntu-22.04' # This must match the platform value defined above.
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf libsoup-3.0-dev
# webkitgtk 4.0 for Tauri v1 - webkitgtk 4.1 for Tauri v2.

- name: install Rust stable
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
if: matrix.settings.platform == 'ubuntu-22.04' # This must match the platform value defined above.
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf libsoup-3.0-dev
# webkitgtk 4.0 for Tauri v1 - webkitgtk 4.1 for Tauri v2.

- name: install Rust stable
Expand Down
179 changes: 179 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
# AI Developer & Agent Onboarding Guide (AGENTS.md)

Welcome, agent! This document serves as your technical manual and architectural reference for developing, debugging, and extending **CoDriver**. Refer to this guide to align with existing design patterns, technology choices, and structural constraints.

---

## πŸš€ Repository Identity & Mission

**CoDriver** is a high-performance, cross-platform desktop file explorer built with **Tauri v2** and **Rust**.
- **No path caching**: Directory exploration is done in real-time, relying on the raw speed of Rust, concurrent disk access (`rayon` & `jwalk`), and CPU power.
- **Cross-platform**: Native feel on Windows, macOS, and Linux.
- **Rich features**: Includes dual-pane layout, miller columns, quick file preview (images, PDFs, video, code), drag-and-drop, multi-format archive compression/extraction, SSHFS mount integration, and Gemini AI-powered features (like image background removal).

---

## πŸ“‚ Directory Structure

Here is a map of the repository's major files and folders:

```
CoDriver/
β”œβ”€β”€ .vscode/ # Workspace settings for VS Code
β”œβ”€β”€ .zed/ # Workspace settings for Zed
β”œβ”€β”€ arch/ # Architecture-specific scripts/files
β”œβ”€β”€ docs/ # Specifications, plans, release notes, and documentation
β”‚ β”œβ”€β”€ design/ # UI/UX mockups and feature specs
β”‚ └── superpowers/ # Active sprint specifications and plans
β”œβ”€β”€ memories/ # AI-agent working state and project context
β”‚ └── project_context.md # High-level summary of active sprints and tech stacks
β”œβ”€β”€ snap/ # Snap packaging configurations (Linux)
β”œβ”€β”€ src-tauri/ # Rust backend code (Tauri Core)
β”‚ β”œβ”€β”€ src/
β”‚ β”‚ β”œβ”€β”€ applications.rs # Desktop application integration helpers
β”‚ β”‚ β”œβ”€β”€ main.rs # Entry point, state, and Tauri command declarations (heavy)
β”‚ β”‚ β”œβ”€β”€ utils.rs # Heavy duty FS operations, watchers, compression
β”‚ β”‚ └── window_tauri_ext.rs # Platform window custom styling integrations
β”‚ β”œβ”€β”€ Cargo.toml # Rust crate dependency map
β”‚ └── tauri.conf.json # Tauri configuration (window sizes, allowlists, assets)
β”œβ”€β”€ ui/ # Frontend assets loaded by Tauri (Vanilla JS + jQuery)
β”‚ β”œβ”€β”€ index.html # Main app shell & modal containers
β”‚ β”œβ”€β”€ main_logic.js # Core UI state manager and operation orchestration (heavy)
β”‚ β”œβ”€β”€ events.js # Global listeners for Tauri-emitted backend events
β”‚ β”œβ”€β”€ contextmenu.js # Custom right-click menu management
β”‚ β”œβ”€β”€ utils.js # Shared DOM and IPC helpers
β”‚ β”œβ”€β”€ models.js # Core JS model definitions (e.g. ActiveAction, Popups)
β”‚ └── style.css # Premium glassmorphism design system & styles
└── README.md # Public orientation document
```

---

## πŸ’» Tech Stack & Architecture

### 1. The Frontend (ui/)
- **Core UI Structure**: Single-page application built on pure HTML5 and vanilla CSS.
- **DOM Orchestration**: Uses **jQuery** (`$`) for event handling, animations, and DOM manipulation. Avoid introducing complex front-end frameworks (React, Vue, etc.) as the project structure relies on global namespace orchestration.
- **Visual Design**: Sleek glassmorphism theme defined in `ui/style.css` leveraging modern CSS variables (e.g., `--primaryColor`, `--textColor`, `--glass-blur`). Features responsive grid/list/miller layouts.
- **Third-Party Libraries**:
- `DragSelect` (`ds.min.js`) for click-and-drag file selections.
- `Font Awesome` (`font-awesome/`) for clean iconography.

### 2. The Backend (src-tauri/)
- **Core**: **Tauri v2** (Tauri v2 has been adopted for the codebase).
- **Disk Walking**: **jwalk** and **walkdir** for highly parallel directory traversals.
- **Concurrency**: **rayon** for multi-threaded operation mapping.
- **FS Watching**: **notify** crate registers platform-specific filesystem watchers to push live updates to the UI.
- **Archive Integrations**: `sevenz-rust`, `zip`, `tar`, `flate2`, `zstd`, `brotlic`, `density-rs`.

---

## πŸ”„ IPC & Tauri Command Integration

Communication between the frontend and the backend is done via Tauri's IPC bridge.

```mermaid
sequenceDiagram
participant UI as ui/main_logic.js
participant IPC as Tauri Invoke Bridge
participant Rust as src-tauri/src/main.rs
participant FS as Local Filesystem

UI->>IPC: invoke("open_dir", { path: "/Users/..." })
IPC->>Rust: open_dir(path)
Rust->>FS: Read directory entries
FS-->>Rust: Entries vector
Rust-->>IPC: FDir Array
IPC-->>UI: Array of JS objects
```

### IPC Convention
1. **Rust Command Declaration** (`src-tauri/src/main.rs`):
```rust
#[tauri::command]
fn your_command_name(custom_argument: String) -> Result<String, String> {
// Backend logic
Ok("Success".into())
}
```
2. **Registration**: Ensure your command is registered inside the `.invoke_handler` list in `main.rs`:
```rust
.invoke_handler(tauri::generate_handler![
list_dirs,
// ...
your_command_name
])
```
3. **JS Invocation** (`ui/main_logic.js`):
Tauri bridges snake_case Rust arguments to camelCase JS properties automatically.
```javascript
const result = await invoke("your_command_name", { customArgument: "value" });
```

---

## 🎨 UI & Styling Guidelines

To maintain visual excellence, follow these rules:
1. **Glassmorphism Theme**: Always utilize the design system's variables from `style.css` rather than static colors.
```css
background: var(--glass-bg);
border: var(--glass-border);
backdrop-filter: var(--glass-blur);
```
2. **Unified Modals & Popups (`.props-card`)**: Refrain from using crude custom layouts or old `.uni-popup` overlays. All interactive modal dialogs (such as Properties, Compress, Extract, Delete Confirm, and FTP Connection) must inherit from the `.props-card` design pattern:
- **Hero Header (`.props-card__hero`)**: Houses a `.props-card__thumb` holding a dedicated Font Awesome icon (or a circular progress loader styled with `.preloader-small-invert` for ongoing processes), and a `.props-card__heading` containing the `.props-card__name` (title) and `.props-card__meta` (subtext or `.props-card__chip` labels).
- **Form Grid Items (`.props-card__list`)**: Wrapped in a `<dl>` list using `<div class="props-card__row">` grid containers (`88px 1fr` layout split). Labels (`<dt class="props-card__label">`) should feature small, clean icons. Value fields (`<dd class="props-card__value">`) house high-contrast text inputs, number fields, or dropdown select boxes styled with the `.props-card__input` class.
- **Form Layout**: Prefer simple vertical stacking for multiple inputs over dynamic horizontal row division to avoid alignment splits and wrap breaks.
- **Structured Footer (`.props-card__footer`)**: Placed at the bottom holding primary and secondary buttons styled with `.props-card__btn` and `.props-card__btn--primary`.
- **Display Activation (JS)**: When showing the modal, always invoke `.style.display = "flex"` (never `"block"`) to allow the card's native flexbox and stretch behaviors to function.
3. **Prevent Placeholder Assets**: When displaying visual helpers, do not use dead layout placeholders. Generate or use proper icon sheets and local resources found in `ui/resources/` or `ui/font-awesome`.
4. **Asynchronous Previews & Circular Loaders**: When displaying large or heavy preview elements (such as PDF files) in modals, avoid setting the resource source immediately inside the HTML template to prevent the UI from freezing. Instead:
- Immediately display the modal container with a centered circular progress loader (using the style of the indicators from the action items, e.g. `.preloader-invert` or `.preloader-small-invert`).
- Load the resource asynchronously in the background by dynamically setting the target element's `src` attribute.
- Listen to the `"load"` event of the element, and once fired, hide the loading indicator, make the preview visible, and transition the background properties (e.g. to a solid white background for high PDF legibility).

---

## πŸ› οΈ Key Developer Workflows & Recipes

### 1. Working with Paths
> [!CAUTION]
> **Path Separator Trap**: Paths are highly platform-dependent. Always normalize paths by replacing double-backslashes `\\` with forward slashes `/` where appropriate on the frontend, and verify that your path adjustments are Windows-safe.

### 2. State & Focus Flags
When implementing new keyboard shortcuts or popups, protect the global UI namespace by checking the state flags in `main_logic.js`:
- `IsPopUpOpen`: Set to `true` when a modal/popup is visible. Prevents general explorer keyboard events (like navigating or deleting) from triggering.
- `IsInputFocused`: Set to `true` when an `<input>` is active. Prevents search shortcuts or navigation commands from intercepting typing.
- `IsDisableShortcuts`: Use to globally silence key interception.

### 3. File Operations & Progress Bars
File operations are handled asynchronously to keep the UI smooth:
- Selecting items buffers them in `ArrSelectedItems` or `ArrCopyItems` (for copy/cut).
- Invoking `arr_copy_paste` runs chunked operations in the Rust backend.
- Rust emits events like `"update-progress-bar"` and `"finish-progress-bar"` which are picked up in `ui/events.js` to update the `.active-actions-container` layout.
- Dismissing the detailed progress modal via **Run in Background** tracks progress silently. Users can click on a progress action item within the active actions popup to invoke `reopenProgressModal()`, which resets the dismissal state, closes the active actions popup, and opens the detailed progress modal populated with live data.

### 4. Running a Local Build
Ensure you have the tauri-cli installed:
```bash
cargo install tauri-cli
```
Run the development environment locally:
```bash
cargo tauri dev
```

---

## πŸ€– AI Guidelines & Prompt Engineering

When developing or debugging this repository, you should prioritize:
1. **Vanilla Style Preservation**: Do not attempt to refactor the jQuery layout into modern JS frameworks (React, Vue, Svelte) unless explicitly requested.
2. **Keep Calculations in Rust**: Heavy calculations, recursive walks, filtering, and heavy text parsing should always reside on the Rust backend (`utils.rs` or `main.rs`) to maintain high desktop performance.
3. **Graceful IPC Failures**: Always wrap Tauri commands in JS `try/catch` and display human-readable notifications using the global toast notification functions:
```javascript
showToast("Action failed: " + error, ToastType.ERROR);
```
4. **Respect AI Provider Selection**: Do not hardcode a specific AI provider (such as Gemini or OpenAI). Always check the active `ai_provider` configuration (e.g. the global `AiProvider` on the frontend, and the settings map in `app_config.json` on the backend). AI commands must query the selected provider and model to ensure user settings and keychain API keys are fully respected.

Loading
Loading