Skip to content

feat: pin/unpin support for ring entries and static slots - #46

Open
suyashkumar102 wants to merge 1 commit into
shaaravraghu:mainfrom
suyashkumar102:feat/pin-entries
Open

feat: pin/unpin support for ring entries and static slots#46
suyashkumar102 wants to merge 1 commit into
shaaravraghu:mainfrom
suyashkumar102:feat/pin-entries

Conversation

@suyashkumar102

Copy link
Copy Markdown

closes #33

added pinned: bool to ClipEntry with serde(default) so existing saved data doesn't break.

eviction in push_dynamic now scans from the back and skips pinned entries instead of blindly popping. if everything is pinned the push is blocked entirely.

Cmd+Opt+P toggles 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.

@suyashkumar102

Copy link
Copy Markdown
Author

@shaaravraghu I've opened the PR
Please add label gssoc:approved and other labels for type, quality and level for gssoc 2026

@shaaravraghu shaaravraghu left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

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 shaaravraghu left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

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.

@shaaravraghu

Copy link
Copy Markdown
Owner

@suyashkumar102 Please refine it.

@shaaravraghu

Copy link
Copy Markdown
Owner

Please sync fork to latest repo.

@shaaravraghu

Copy link
Copy Markdown
Owner

@suyashkumar102

@xthxr xthxr 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.

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

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.

[Enhancement] Allow individual ring entries to be pinned and protected from eviction

3 participants