Skip to content

fix: highlight favourite icon and sort favourites alphabetically#255

Merged
unsecretised merged 2 commits intoRustCastLabs:masterfrom
niklasmarderx:fix/favourite-highlight-254
Apr 1, 2026
Merged

fix: highlight favourite icon and sort favourites alphabetically#255
unsecretised merged 2 commits intoRustCastLabs:masterfrom
niklasmarderx:fix/favourite-highlight-254

Conversation

@niklasmarderx
Copy link
Copy Markdown
Contributor

Problem

The favourite heart icon looks the same regardless of whether an app is actually favourited. There's no visual feedback after toggling.

Additionally, the favourites list isn't sorted, making it harder to find apps.

Fix

  • Show ❤️ for favourites and 🤍 for non-favourites
  • Favourite items render with full text opacity; non-favourites are dimmed
  • Favourites list is now sorted alphabetically by display name

Changes

  • styles.rs: favourite_button_style takes an is_favourite param to adjust text brightness
  • apps.rs: picks heart emoji and passes favourite state to the style function
  • tile.rs: get_favourites sorts results by display_name

Closes #254

The heart icon now shows ❤️ for favourites and 🤍 for non-favourites,
with brighter text when the app is marked as a favourite. Previously
the icon looked the same regardless of favourite status.

Favourites are now sorted alphabetically by display name.

Closes RustCastLabs#254
src/styles.rs Outdated
status: button::Status,
is_favourite: bool,
) -> button::Style {
let text_color = if is_favourite {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

can we bring out the match statement?

Maybe it would be possible to just:

let (press_opacity, hover_clr) = if is_favourite { 
    // evaluate opacity here
 }

src/app/apps.rs Outdated
let name = self.search_name.clone();
let theme_clone = theme.clone();
let is_favourite = self.ranking == -1;
let heart = if is_favourite { "❤️" } else { "🤍" };
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

to iced they're the same

Copy link
Copy Markdown
Collaborator

@unsecretised unsecretised left a comment

Choose a reason for hiding this comment

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

Looks mostly good, just a bit of code quality and the fact that iced doesn't actually care about the colour of the emoji.. its going to be the same.

Also, I'm not sure if there was AI used in this. Do let me know if there was, and how much.

@niklasmarderx niklasmarderx force-pushed the fix/favourite-highlight-254 branch from d77467e to 5a0a123 Compare April 1, 2026 08:55
@niklasmarderx
Copy link
Copy Markdown
Contributor Author

Addressed both points:

  • Pulled the match into a single block with a (base, pressed, hovered) tuple — much cleaner, thanks
  • Dropped the emoji swap since iced renders them identically

Re AI: used it minimally to find the issue and understand the codebase structure. Probably should have leaned on it more for the iced emoji thing honestly

@unsecretised
Copy link
Copy Markdown
Collaborator

LGTM then

Copy link
Copy Markdown
Collaborator

@unsecretised unsecretised left a comment

Choose a reason for hiding this comment

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

LGTM

@unsecretised unsecretised merged commit 8e16009 into RustCastLabs:master Apr 1, 2026
2 checks passed
@Merc-86
Copy link
Copy Markdown

Merc-86 commented Apr 1, 2026

Show ❤️ for favourites and 🤍 for non-favourites

would prefer white highlighted for fav. and greyed out for non favs. keeps it from becoming a 🎄

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.

Favourite icon don’t stays highlighted

3 participants