Elastic: Show contact photo in recipient autocomplete list - #10272
Open
listumps wants to merge 1 commit into
Open
Elastic: Show contact photo in recipient autocomplete list#10272listumps wants to merge 1 commit into
listumps wants to merge 1 commit into
Conversation
Show the contact's vCard photo instead of the generic icon in the To/Cc/Bcc autocomplete dropdown, when available. The photo is already parsed on every autocomplete search (rcube_contacts::search() always reads the vCard), so this adds no extra query cost. autocomplete.php exposes a photo URL per matching contact, skipping external http(s):// photos since contacts/photo.php redirects to those - attaching one here would fire a silent third-party request on every keystroke instead of only when a contact is deliberately opened. Both ksearch_results_display() in app.js and Elastic's ui.js override of it (used for its small-screen layout) render the photo in place of the icon when present.
listumps
force-pushed
the
feature/autocomplete-contact-photo
branch
from
July 16, 2026 17:51
2763b71 to
7a405aa
Compare
Contributor
Author
|
Removed the CHANGELOG.md entry from this PR, following the guidance given to @MiMoHo on another PR (changelog entries create unnecessary merge conflicts between PRs). Force-pushed the amended commit - PR now only touches the 4 code files. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
rcube_contacts::search()always reads the vCard), so this adds no extra query cost -autocomplete.phpjust exposes a URL to the existingcontacts/photoaction per matching contact.http(s)://URLs are intentionally excluded:contacts/photo.php302-redirects the browser to those, and attaching one here would fire a silent third-party request on every keystroke for any matching contact, rather than only when a contact/email is deliberately opened.ksearch_results_display()inapp.jsand Elastic's own override of it inui.js(used for its small-screen layout) needed updating, since the skin's override completely replaces the base implementation..listingrow height (@listing-line-height) and keeps its natural aspect ratio rather than being cropped to a circle, consistent with how photos are shown elsewhere in the app (Contacts page, sender photo in message preview).Test plan
php -land the project's.php-cs-fixer.dist.phpconfig (0 fixable issues) forautocomplete.phpeslint(project config) forapp.jsandui.js.lesschange compiles cleanly vialesscagainst the fullstyles.lessentry point