Skip to content

Show the website name on the search item of the history menu - #387

Merged
marin-m merged 5 commits into
marin-m:mainfrom
HarpeLm:fix/search-menu-label
Nov 22, 2026
Merged

marin-m merged 5 commits into
marin-m:mainfrom
HarpeLm:fix/search-menu-label

Conversation

@HarpeLm

@HarpeLm HarpeLm commented Nov 15, 2026

Copy link
Copy Markdown
Contributor

The website name set in the preferences ("Search on YouTube" by default) is shown on the search row of the main window, but the history and favorites context menus always said "Search on YouTube", even though that item opens the configured website. With a custom search engine, the menu promised YouTube and opened another site.

This change:

  • adds set_search_item_label(menu, label) in context_menu.rs. It finds the item with the history-menu.search-on-youtube action in the sections of a menu, and replaces it with a copy that has the new label, at the same position, with the same action and icon (a GMenu item can't be relabeled in place);
  • adds show_website_search_label in main_window.rs, which sets the main window's search row title, as before, and relabels the search item of both history context menus. It's called at startup and when the website name changes in the preferences.

The stored preference and the action are unchanged.

Testing:

  • New unit test on a menu with the same sections as history_context_model: the search item takes the new label and keeps its action, icon and position, the other items are untouched, and a second rename relabels the same item. It fails if the action name doesn't match.
  • In the running app (macOS), with website_search_text = "Search on Bandcamp" in preferences.toml: both history_context_model and history_context_model_faved had the item relabeled, with its action and icon (checked with a temporary log, not committed). I didn't open the menu by hand.
  • cargo test and cargo test --no-default-features -F ffmpeg: passing on macOS. cargo fmt --check: clean. No new warnings.

The search row of the main window takes the website name set in the
preferences, but the history context menus kept "Search on YouTube"
while searching on the configured website. Relabel their search item at
startup and when the name changes.
@marin-m

marin-m commented Nov 22, 2026

Copy link
Copy Markdown
Owner

Thank you, if you submit AI-issued PRs please think to check that all tests are relevant and that the comments and function names are clear.

@marin-m
marin-m merged commit fb4bedf into marin-m:main Nov 22, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants