Skip to content

"Starred" User Bookmarks - #1982

Open
MikhailValerie wants to merge 12 commits into
pop-os:masterfrom
MikhailValerie:feature/353
Open

"Starred" User Bookmarks#1982
MikhailValerie wants to merge 12 commits into
pop-os:masterfrom
MikhailValerie:feature/353

Conversation

@MikhailValerie

@MikhailValerie MikhailValerie commented Aug 17, 2026

Copy link
Copy Markdown

Added User Bookmarks via a special "Starred" tab with a pinned sidebar item (like Recents) and a sortable "Starred" column in List View. The list view icons are clickable buttons to toggle the bookmark state immediately. The Starred tab is searchable, to be consistent with Recents and Trash.

Starred Location

There is a new "Starred" location that only appears when the "Show starred" config is enabled. This page lists all the items that the user has starred (a.k.a. bookmarked) in one easy location.
image

New Config, off by default

There is a new "Show starred" setting option that is off by default ( unless pre-added to the COSMIC Files settings file ) that reveals the new features when enabled. Disabling the setting does not forget the starred bookmarks.
image

List View

The List View shows the "Star" column at the far right when the feature is enabled
image

List View (Condensed)

The condensed List View still shows the "Star" column at the far right.
Screenshot_2026-08-27_19-59-09

Grid View

For Grid View the icon displays below the names, which are now to 2 lines while Starred are shown, and the original 3 lines while disabled. This keeps the item density (and positioning) the same between both options.
image

Sort Menu

There are now two new options for the Sort Menu that only appear while the "Show starred" feature is enabled, allowing sorting by "Starred first" or "Starred last" and honouring the "List directories first" setting.
image

Add to sidebar

The existing Add to sidebar functionality covered both pinned locations and user bookmarks, resulting in a bad UX when a lot of files and directories were added. This update changes this, only allowing users to pin directories to the sidebar but not files, creating a clear separation between the two concepts.

NOTE: Several options were explored and there are two best choices for the header: star or empty - see the comments below - the current code has the star icon

Context menus

The context menu for both files and directories now shows "Add to starred" instead of "Add to sidebar", however directories will list both items. Neither option appears when inside the Trash location.
When inside the Starred location, or when a file is already starred the context menu will have the "Remove from starred" action.
image

Keyboard Shortcuts

The Ctrl + D shortcut has been taken over by the "Add to starred" functionality, which is expected to be used more frequently than the adjusted "Add to sidebar" capability. The latter has been moved to Ctrl + Shift + D as a keyboard shortcut. Both keyboard key binds are additive and there is no shortcut for "Remove from starred".

Selections

The keyboard shortcuts and context menus support selections too, only showing the options relevant to the current selection. "Add to sidebar" only shows if all selected items are directories,; "Add to starred" and
"Remove from starred" can both be shown if there's a mix in the selection.

Trash

The "Trash" tab does not show starred and does not have the context menu items. Restoring a starred item from trash will cause it to reappear in the "Starred" area, as the location is still preserved in the user-places.xbel

Freedesktop Standard

Bookmarks are stored in the ~/.local/share/user-places.xbel file, to be shared with other compliant programs.

NOTE: This file is used by KDE's Dolphin file browser to manage the pinned "Places" in the sidebar, not favourites like I had assumed. Gnome Files (Nautilus) uses an internal DB for this.

Dependencies

This requires a new library to edit the user-places.xbel file storing the bookmarks. I have created user_places_xbel forked from recent_places_xbel to point to the new file and to bring in atomic writes and other bug fixes.

Other impacts

The building of the List View headers was tweaked to fix positional issue and to support icons as headers. This will impact other PRs adjusting this list, such as including a Types column. The changes made here are easy to adjust to, and should pave the way to having user-specified optional columns.

The user-places-xbel library should really be merged with the recent-places-xbel library into a generic XBEL handler, but as I don't know the wider impact I placed it safe via a fork.

Related to: #353


  • [☑️ ] I have disclosed use of any AI generated code in my commit messages.
    • If you are using an LLM, and do not fully understand the changes it is making to the code base, do not create a PR.
    • In our experience, AI generated code often results in overly complex code that lacks enough context for a proper fix or feature inclusion. This results in considerably longer code reviews. Due to this, AI authored or partially authored PRs may be closed without comment.
  • [ ☑️] I understand these changes in full and will be able to respond to review comments.
  • [ ☑️] My change is accurately described in the commit message.
  • [ ☑️] My contribution is tested and working as described.
  • [ ☑️] I have read the Developer Certificate of Origin and certify my contribution under its conditions.

@KodeBarista

Copy link
Copy Markdown
Contributor

Perhaps table header doesn't require the bookmark icon?

@MikhailValerie

Copy link
Copy Markdown
Author

Perhaps table header doesn't require the bookmark icon?

I wasn't too sure about that myself, but the column is sortable and I didn't like the UX behind an empty header and "Bookmarks" made the column unnecessarily wide. "Star" could work, but then I'd need to rename everything from "Bookmarks" to "Starred".

I'll post screenshots of a few variations of the header to compare the options.

@MikhailValerie

Copy link
Copy Markdown
Author

I've evaluated a few options, and asked a few regular people I know and the current icon in header still seems to be the best option.

image

Empty Header

Here is the empty header, but the sort icon is then misaligned
image

Screenshot_2026-08-18_14-55-22

Which is the same as Gnome Files (Nautilus)
Screenshot_2026-08-18_15-01-28

The words "Bookmarks" and "Starred" both overflow out the right-side of the column and hide the sort icon, or otherwise make the column unnecessarily wide.

I do prefer "Bookmarks" but "Starred" is consistent with the icon shape and other file browsers, so I'll be renaming to match.

@KodeBarista

This comment was marked as resolved.

@MikhailValerie MikhailValerie changed the title User Bookmarks via Freedesktop standard "Starred" User Bookmarks Aug 18, 2026
@MikhailValerie

MikhailValerie commented Aug 18, 2026

Copy link
Copy Markdown
Author

I'm getting this error while trying to star an item.
image

Thanks for pointing that out - I just noticed it myself when testing with Dolphin and Nautilus installed. It looks to be an issue with the underlying user-places-xbel library that I forked from recent-places-xbel not handling the KDE formatting: either indents or a numerical <ID> value. I'm investigating that now.

EDIT: The issue appears to be with mapping certain structures and missing attributes within the xbel file to the internal structs when reading (done on writing to 'update' instead of append). The indentation and KDE-specific blocks are ignored. The current code is optimistic on what it'll find, so I'm looking to have it just ignore bad structures, not just unknown ones.

There is no issue in the COSMIC Files code for this unless we want to double-handle errors, or auto-disable the feature on such an error.

If you rename the existing file it should auto-create an empty one to test the feature with, and then you can roll back when finished.

@MikhailValerie

Copy link
Copy Markdown
Author

That issue has been fixed now - the user-places-xbel (and thus the recent-places-xbel) libraries could not handle XML structures missing certain attributes or with multiple <metadata> blocks, as written by Dolphin.
I've updated the underlying library to support Option<> and Vec<> for the structs to handle these differences.

In testing this I realised that I had left a cap of 50 items in the Starred page with unnecessary filtering via date, so I've pushed a fix for that. I've also rebased onto the updated master branch as they created #1985 for epoch 1.6.0

I'd love for you to check again with both a reset xbel file and your original file - take backups first! Thank you.

@KodeBarista

Copy link
Copy Markdown
Contributor

The issue has been fixed now!

@MikhailValerie

Copy link
Copy Markdown
Author

There are now some branch conflicts needing resolving and I've decided that I should have supported both Grid View and the compact list before marking as 'ready'. I'm working on those changes now.

Trigger rescanning the Recents tab when deleting a file, forcing it to no longer display the deleted file
Trigger rescanning the Recents tab when deleting a file.
Trigger rescanning the Recents tab after processing each completed operation, and when watching the Trash.

This allows it to cover:
 - Moving a file to Trash from anywhere
 - Restoring a file from Trash
 - Renaming a file from anywhere
This requries a new dependency: "user-places-xbel" forked from "recently-used-xbel"

Add a new Sidebar item for the Bookmarks tab, and a setting to show/hide it, similar to the Recents tab.  Bookmarks icon is different when no bookmarks made.

File context menus now have "Add to Bookmarks" next to "Add to Sidebar" unless within the Bookmarks location, which has "Remove from Bookmarks"
Added new column to indicate whether an item is bookmarked or not.   This icon is a clickable button to toggle the bookmarked state.

The right-click context menu is now smarter for Add to Bookmarks or Remove from Bookmarks.

STILL TO DO:
 - Refresh bookmarked icon state immediately
 - Spacing to align bookmarked column icons
- Add to Sidebar to be restricted to Directories only
- Reduced file calls to user_places.xbel
- Hide column if bookmarks are hidden
+ Added show_bookmarks to TabConfig to pass down for views
 + Don't toggle Bookmarks icon in sidebar
+ Add to Sidebar restricted to Directories only
+ Hide Bookmark column if bookmarks are hidden
+ Changed wording of setting as it now hides the column too
+ Fixed Open With for Bookmarks location
+ Updated keyboard shortcuts: [Ctrl] + [D] is Add to bookmarks and [Ctrl] + [Shift] + [D] is Add to sidebar
+ Build the list view columns more dynamically
 + Padding to align bookmarked column icons

STILL TO DO:
- Reduced file calls to user_places.xbel
- Atomic updates in user-places-xbel to prevent: WARN  Error reading bookmarks files: Deserialization(UnexpectedEof)
+ Call user_places_xbel::read_user_places() instead of user_places_xbel::parse_file() to create file if missing
+ Fixed alignment of bookmarks column

STILL TO DO:
- Reduced file calls to user_places.xbel
+ Renamed all variables from "bookmarks" to "starred", except for those in the user_places_xbel crate
+ Fixed glitch where List View headers would disappear early when shrinking the window into condensed view
+ Shrunk column widths to allow for more compact  view before switching to condensed
+ Removed overlooked filtering, sorting and limiting of Starred items to max of 50.  It now lists all starred items it can parse.
+ Added Sort menu options for toggling the "Starred" sorting.
+ Refactored menu_bar() to make it easier to edit contents based on config, such as possible sort by Type in the future
This implements Starred for Grid View by sacrificing the third line of text to show the Star button, keeping the same item density as before.

I would have preferred to have the star overlayed on top of the icon, but that does not seem possible yet..
@MikhailValerie
MikhailValerie marked this pull request as ready for review August 27, 2026 12:00
@KodeBarista

KodeBarista commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Hi, I just tested this out & I have a couple of things to report/suggest:

  • Suggestion: In list view, use an outlined star in the header when no items in the directory are starred, and a filled icon when at least one item is starred.

  • Suggestion: Wouldn't it be a good idea to let Ctrl+D work as a toggle to quickly star and unstar items? Currently, it only supports starring items.

  • Bug: When an item is selected, starring new items doesn't update the UI until the view is refreshed or Escape is pressed to remove the selection. After that, starring a new item updates the view, causing multiple items to get their starred UI updated at once.

  • Thoughts on this UI? (More space efficient) - Nautilus has done a good job with the UI, but the UX in grid view could be better, since one can't unstar an item directly from the star icon, it selects the item instead.

image

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