-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[omnibox][rich-autocompletion][bookmark-paths] Show URL for rich ac bks.
**tldr** When bookmarks are rich autocompleted with a path-matched shortcut text, the omnibox inlines `tit[le] - folder/title`, with no indication of the URL. https://screenshot.googleplex.com/5Fp9eneifmYy7Pv **Features** With the launch of bookmark paths, bookmarks may show their bookmark path instead of their URL in the dropdown. This is fine, since selecting the suggestion will show the `fill_into_edit` (formatted URL) in the omnibox. With the launch of rich AC, non-URL inputs may inline matches. Inlined matches show their `inline_autocompletion` and `additional_text` in the omnibox, instead of their `fill_into_edit`. `inline_autocompletion` can be the title, URL, or shortcut text, whichever the user was typing. `additional_text` will equal `contents` when the user was typing title, and empty otherwise. This too is fine, as `contents` is always the URL for bookmarks. But when both features are enabled jointly, then bookmarks can be inlined with `contents` set to their path instead of their URL. **Current behavior** Say we suggest a bookmark shortcut named 'title', in folder 'folder, and with the url 'url.com'. When selected from the dropdown: 1) For the shortcut text 'url', the omnibox displays 'url.com'. 2) For the shortcut text 'url title', the omnibox displays 'url.com'. 3) For the shortcut text 'title', the omnibox displays 'url.com'. When rich autocompleted and inlined: 4) For the shortcut text 'url', the omnibox displays 'url.com'. 5) For the shortcut text 'url title', the omnibox displays 'url title - url.com'. 6) For the shortcut text 'title', the omnibox displays 'title - folder/title'. **The change** Case 6 is problematic, as the user has no reminder where they're going to navigate to when they select the suggestion. Case 6 didn't occur until the launch of both features, hence it wasn't an issue until now. This CL fixes case 6 to display 'title - url.com' instead. For cases 5 & 6, this CL also changes *dropdown text* to display 'title - url.com' instead of 'title - folder/title'. Doing so addresses the risk of shortcut bookmarks showing stale paths after the bookmark is moved. Though if the bookmark is also provided from the bookmark provider, it will be preferred, and the dropdown text will continue showing 'title - folder/title'. **Impelemntation details** We previously added the `description_for_shortcuts` field to allow the doc provider to show a different description when shortcuted than its original description to avoid a stale description. Since this situation is similar, i.e. we want to show a different contents* (as opposed to description) when shortcuted than its original contents, we reuse the same field. So for bookmarks, `description` will be the title, `contents` will be the URL or path, while `description_for_shortcut` will be the URL. This is a bit messy, since `description_for_shortcuts` now actually represents the contents for bookmarks (i.e. when `swap_contents_and_description` is true). But since we hope to eventually remove `swap_contents_and_description` field, the interim messiness seems better than adding yet another field `contents_for_shortcuts`. This bug doesn't apply to non-shortcut bookmarks, as those won't rich autocomlete and therefore always inline their URLs. This fix won't fix existing shortcuts, as they were persisted with their original contents rather than the `description_for_shortcuts`. Bug: 1347986, 1129524 Change-Id: I285fb31b714848c75c89d7ea6c824a4b78018bf4 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4159819 Reviewed-by: Justin Donnelly <jdonnelly@chromium.org> Commit-Queue: manuk hovanesian <manukh@chromium.org> Cr-Commit-Position: refs/heads/main@{#1098408}
- Loading branch information
manukh
authored and
Chromium LUCI CQ
committed
Jan 29, 2023
1 parent
f15665f
commit a94386f
Showing
7 changed files
with
162 additions
and
52 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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