Repository navigation
feat(set): add --promote flag to update event timestamp on set - #25
Merged
Merged
Conversation
Nadim147c
requested changes
Aug 1, 2026
Comment on lines
+20
to
+26
| Long: `Set clipboard content from history by event ID. | ||
|
|
||
| With --promote, the event timestamp is updated to now, | ||
| moving it to the top of the list on next load.`, | ||
| Example: ` yankd set 019fb267-e9b8-700d-a100-643a7e8bf651 | ||
| yankd set --promote 019fb267-e9b8-700d-a100-643a7e8bf651 | ||
| yankd set -p 019fb267-e9b8-700d-a100-643a7e8bf651`, |
Owner
There was a problem hiding this comment.
Suggested change
| Long: `Set clipboard content from history by event ID. | |
| With --promote, the event timestamp is updated to now, | |
| moving it to the top of the list on next load.`, | |
| Example: ` yankd set 019fb267-e9b8-700d-a100-643a7e8bf651 | |
| yankd set --promote 019fb267-e9b8-700d-a100-643a7e8bf651 | |
| yankd set -p 019fb267-e9b8-700d-a100-643a7e8bf651`, | |
| Example: ` | |
| # Restore clipboard of given id | |
| yankd set 019fb267-e9b8-700d-a100-643a7e8bf651 | |
| # Restore clipboard of given id and update timestamp | |
| yankd set --promote 019fb267-e9b8-700d-a100-643a7e8bf651 | |
| `, | |
I prefer this style.
| } | ||
|
|
||
| res, err := ipc.SetEvent(cmd.Context(), id) | ||
| promote, _ := cmd.Flags().GetBool("promote") |
Owner
There was a problem hiding this comment.
Please, use viper.GetBool("promote")!
WayneKent
force-pushed
the
feat/set-promote
branch
from
August 1, 2026 15:32
9a738dd to
3f87f03
Compare
Nadim147c
approved these changes
Aug 1, 2026
Owner
|
LGTM! Please run a |
- Add UpdateEventTime DB method to update an event timestamp - Add --promote (-p) flag to `yankd set` CLI command - Add Long description and Example for the set command - Update ipc/README.md with promote query param docs - When ?promote=true is present, update the event time to now after setting clipboard content, promoting it to the top
WayneKent
force-pushed
the
feat/set-promote
branch
from
August 1, 2026 15:37
3f87f03 to
e20e4ea
Compare
Contributor
Author
|
Done, ran gofumpt. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add a
--promoteflag toyankd setthat updates the event timestamp to now when setting clipboard content, moving the item to the top of the list.Changes
internal/db/update.go:UpdateEventTimeDB method to update an event's timestampinternal/ipc/set.go:SetEventnow accepts apromote boolparameter; when?promote=truequery param is present, the event time is updated after setting to clipboardcmd/set.go:yankd setgains--promote/-pflag, plusLongdescription andExampleinternal/ipc/README.md: Document the?promote=truequery parameterUsage
Without the flag/param, behavior is unchanged.