Skip to content

feat: file saving into .qrate, autosave + Ctrl+S, floating cell editor - #47

Merged
devnull03 merged 7 commits into
mainfrom
feat/file-saving-and-editor
Jul 21, 2026
Merged

devnull03 merged 7 commits into
mainfrom
feat/file-saving-and-editor

Conversation

@devnull03

Copy link
Copy Markdown
Owner

Summary

Two related chunks, one per commit.

1. Persist cell edits to .qrate (ac23747)
Cell edits were held in memory only — nothing wrote them back. Added a whole-table rewrite of dataset_main, in one transaction (crash-safe), written in the project's original column order so it stays in sync with the separately-saved column layout. Triggered by:

  • a new Autosave setting — timed/buffered (default), immediate, or off
  • Ctrl+S (global action) and a quit-time flush of pending edits

Unsaved state now shows as a dot before the project name in the title bar, driven by the dirty tracker via a global observer.

2. Floating cell editor + sticky highlighted headers (4696196)
Replaced the inline editor with a floating one: deferred + anchored (Local) paint it above the grid so it overflows the cramped cell, and snap_to_window keeps it on-screen near any edge. While a cell is active, its row number and column header highlight (Google-Sheets style) — both were already sticky (fixed_left # column, pinned header row), so the highlight stays put while scrolling.

Verification

  • cargo fmt --all --check — pass
  • cargo clippy -p settings -p table -p window-wrapper -p app --all-targets -- -D warnings -A dead_code — pass
  • cargo test -p settings -p table — pass (incl. new save_dataset_rewrites_rows_and_round_trips, snapshot_order_follows_ckey_not_display_order)
  • Full cargo test --workspace not run to completion locally — draft; worth confirming in CI.

Notes / follow-ups

  • Autosave dropdown renders blank until a value is picked (behavior still defaults to timed); seeding a visible default was deferred.
  • Not yet visually smoke-tested in the running app — the floating editor's on-screen position and the header highlight colors are worth an eyeball pass.

…ndicator

Cell edits were held in memory only; nothing wrote them back. Add a whole-table
rewrite of dataset_main (in the project's original column order, so the saved
column layout stays in sync) triggered by:

- a new Autosave setting: timed/buffered (default), immediate, or off
- Ctrl+S (global action), and a quit-time flush of pending edits

Surface unsaved state as a dot before the project name in the title bar, fed by
the dirty tracker via a global observer.
…headers

Replace the inline cell editor with a floating one: `deferred` + `anchored`
(Local mode) paint the editor above the grid so it overflows the cramped cell,
and `snap_to_window` keeps it fully on-screen near any edge. The plain text stays
underneath so row height and neighbours are unaffected.

While a cell is active (being edited or selected), highlight its row number and
column header (Google-Sheets style). Both are already sticky — the `#` column is
fixed_left and the header row pins to the top — so the highlight stays put as the
grid scrolls under it.
@devnull03
devnull03 force-pushed the feat/file-saving-and-editor branch from 4696196 to 5ac7b42 Compare July 20, 2026 12:40
…safe

Long values now wrap and grow the box downward (`auto_grow`, Enter commits /
Shift+Enter newlines) instead of scrolling sideways, capped to the table's
measured width. A new `clamped_float` element floats the editor like
`anchored(Local)` but confines it to the table rect (gpui only clamps to the
window), so it can't spill over a side panel, and `.occlude()` stops clicks
falling through to the grid behind it.
@devnull03
devnull03 marked this pull request as ready for review July 20, 2026 16:21
Copilot AI review requested due to automatic review settings July 20, 2026 16:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

gpui's `img` stamps the element with the image's own aspect ratio, so a
`size_full` img ignored the frame shape and `object_fit(Contain)` had nothing
to letterbox. Size it by its intrinsic ratio under `max_w/h_full` inside a
centered wrapper so it fits with bars, and render square corners.
Drag the bottom-right grip to resize the floating editor; the chosen
width/height persist in user-scope settings and are clamped to sane
minimums and the table bounds. The drag captures the start mouse
position and box size so each move applies the delta from the start.
Autosave becomes a switch plus a method dropdown (shown only while on),
both editing the one AUTOSAVE_KEY the table reads. Column filters become
a master switch gating a multi-select picker whose selection is the set
of filter-enabled columns; the picker mirrors gpui-component's menu-item
styling and its trigger shows "First +N others". The Settings window now
observes the settings globals so these scope-dependent rows rebuild live.
The table gates every filter dropdown behind the master switch.
Add File > Save (wired to the existing Save action / Ctrl+S). The
title-bar unsaved dot now tracks only PROJECT_DATA instead of any dirty
domain, so auto-persisted column layout/settings no longer light it
forever. Closing the window with unsaved cell edits prompts Save / Don't
Save / Cancel; Don't Save clears the mark so the quit flush discards it.
@devnull03
devnull03 merged commit 73fc118 into main Jul 21, 2026
2 checks passed
@devnull03
devnull03 deleted the feat/file-saving-and-editor branch July 21, 2026 11:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants