Skip to content

feat: add user customisable default archive display behaviour #1505

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jun 1, 2025

Conversation

xuatz
Copy link
Collaborator

@xuatz xuatz commented May 31, 2025

Summary

  • added new global user setting Archive Display Behaviour
    • defaults to existing behaviour; show archived in tag/list
  • update tags and list query to conditionally hide archived bookmarks
  • add ?includeArchived=true|false to support ephemeral override
    • toggleable via one of the action in the ••• menu

Possible Further Improvements

  • show a badge showing how many bookmarks are hidden
  • show a pill in the ••• menu or in the search bar to let the users know that a filter is applied

Screenshots

image

image

image

fixes #697

Comment on lines 104 to 114
"bookmark_click_action": {
"title": "Bookmark Click Action",
"open_external_url": "Open Original URL",
"open_bookmark_details": "Open Bookmark Details"
},
"archive_display_behaviour": {
"title": "Archive Display Mode",
"show": "Show up in tags and lists",
"hide": "Hide in tags and lists"
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

thought it might be a little nicer to nest related text for each setting instead of having them all flat. but im totally fine to revert this change as well

@xuatz
Copy link
Collaborator Author

xuatz commented May 31, 2025

I only finished the initial user settings implementation, but I think we can already discuss a little about the choice of text to see if it accurately describes what we want to do. Let me know if the text could be improved to more accurately describe the feature. @jl-678

@@ -101,9 +101,16 @@
"interface_lang": "Interface Language",
"user_settings": {
"user_settings_updated": "User settings have been updated!",
"boomark_click_action": "Bookmark Click Action",
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

typo fix

-  boomark_click_action
+  bookmark_click_action

query={{ listId: list.id }}
query={{
listId: list.id,
includeArchived,
Copy link
Collaborator

Choose a reason for hiding this comment

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

here, if we pass archived: false when !includeArchived, we can avoid all the changes to trpc. If includeArchived is true, we don't need to pass any filtering by archive, so we pass undefined

@xuatz xuatz force-pushed the feat/hide-archived-content branch from 8a88cf0 to ddea05f Compare June 1, 2025 16:45
@@ -95,6 +95,7 @@ describe("User Routes", () => {
await expect(() => user2Caller.users.list()).rejects.toThrow(/FORBIDDEN/);
});

// TODO may want to add a test for `archiveDisplayBehaviour` as well
Copy link
Collaborator Author

@xuatz xuatz Jun 1, 2025

Choose a reason for hiding this comment

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

are you strict with requiring tests? ^^

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it's fine, the tests are mostly testing the edit/get functionality not the specific setting

@xuatz xuatz marked this pull request as ready for review June 1, 2025 17:35
Copy link
Collaborator

@MohamedBassem MohamedBassem left a comment

Choose a reason for hiding this comment

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

Looks good to me! Did some small changes (e.g. nuqs), but other than that, this is ready to be merged!

@@ -95,6 +95,7 @@ describe("User Routes", () => {
await expect(() => user2Caller.users.list()).rejects.toThrow(/FORBIDDEN/);
});

// TODO may want to add a test for `archiveDisplayBehaviour` as well
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it's fine, the tests are mostly testing the edit/get functionality not the specific setting

@MohamedBassem MohamedBassem merged commit 3afe1e2 into karakeep-app:main Jun 1, 2025
5 checks passed
@jl-678
Copy link

jl-678 commented Jun 24, 2025

Not sure if I should comment here, but I have been playing with this feature and notice that the setting is not maintained between sessions. Is that expected behavior?

@xuatz
Copy link
Collaborator Author

xuatz commented Jun 24, 2025

Not sure if I should comment here, but I have been playing with this feature and notice that the setting is not maintained between sessions. Is that expected behavior?

@jl-678 the global user setting is persisted. The list override is ephemeral as designed. You can set the default global setting to hide as always

@jl-678
Copy link

jl-678 commented Jun 24, 2025

Awesome, thank you.

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.

Option to remove archived content from lists and tags
3 participants