feat: pin/unpin support for ring entries and static slots - #46
feat: pin/unpin support for ring entries and static slots#46suyashkumar102 wants to merge 1 commit into
Conversation
|
@shaaravraghu I've opened the PR |
shaaravraghu
left a comment
There was a problem hiding this comment.
Static-mode storage is split into two disconnected sources of truth, so the new pinned/static behavior does not actually persist and can hide previously saved slots after startup. Engine now creates its own empty StaticSlotStore and all static operations read/write that private store (src/engine.rs (line 18), src/engine.rs (line 25), src/engine.rs (line 200), src/engine.rs (line 407)). But disk load/flush still only uses RamStore.static_slots (src/storage/disk.rs (line 41), src/storage/disk.rs (line 78)). That means:
static slots loaded from disk are never copied into Engine::static_store, so existing saved static entries can appear empty after restart;
new static copy/cut/delete/pin/encrypt/decrypt changes never mark RamStore dirty, so they are not flushed back to disk;
the PR message’s claim that static pin state “is persisted automatically” is false in the current implementation.
shaaravraghu
left a comment
There was a problem hiding this comment.
Both paste paths now paste even when clipboard sync fails, which can paste stale system clipboard contents instead of the selected entry. static_paste and dynamic_paste call self.sync_to_system_clipboard(...) and then unconditionally fire simulate_paste_delayed() (src/engine.rs (line 238), src/engine.rs (line 341)). The old helper only pasted on successful sync (src/engine.rs (line 129)). That is a real behavioral regression for any clipboard write failure.
|
@suyashkumar102 Please refine it. |
|
Please sync fork to latest repo. |
xthxr
left a comment
There was a problem hiding this comment.
Please follow the plan related to the issue. If any additional files/ resources are added for checking functionality/ testing; please remove them. Please provide a clean commit. @suyashkumar102
closes #33
added
pinned: booltoClipEntrywithserde(default)so existing saved data doesn't break.eviction in
push_dynamicnow scans from the back and skips pinned entries instead of blindly popping. if everything is pinned the push is blocked entirely.Cmd+Opt+Ptoggles pin on the current cursor entry, follows the same release-triggered pattern as C/V/X in chord.rs.for static mode, trying to copy or cut into a pinned slot fails immediately with a notification — the content in that slot stays untouched.
pin state is persisted automatically since disk.rs already serialises the full ClipEntry struct.