[19.0][IMP] mail_attach_existing_attachment: foldable attachment sections - #243
Open
cliffkujala wants to merge 3 commits into
Open
Conversation
The composer listed every attachment already on the record as one long column of checkboxes, which pushes Send off screen on a record with any mail history. Group the composer's attachments under two foldable headers instead. "Available Attachments" holds the picker, starts folded, and lays its checkboxes out in as many columns as the composer is wide enough for. "New Attachments" shows the files added to this mail as the same cards the chatter uses, and only appears once there is one. The picker also loads its choices with search_read rather than name_search, whose default limit of 100 silently dropped the oldest attachments, and shows each file's size to tell apart the images a mail thread accumulates under names like image001.png.
3 tasks
Member
|
Please put screenshots. Is this AI assisted? You should indicate it if so. Another thing: this seems more |
Author
In a column narrow enough to matter, the size label gave up space along
with the filename and wrapped ("12.67" over "Kb"), making that one entry
two lines tall and knocking the rest of its grid row out of alignment.
Pin the size at its natural width and let the name be the only part that
shrinks, so it truncates and the row stays one line. Both spans get a
class of their own rather than being matched by position, since an
attachment with no recorded size has no second span at all.
…ew on hover Odoo sizes .o-checkbox with width: fit-content. The name is nowrap, so its min-content width is the whole filename and fit-content resolved to that: rows sized themselves to their text and spilled across the next column's checkbox instead of truncating. min-width: 0 cannot override an explicit width, so stretch the row to its grid track. Truncating hides information, so give it back on hover. The tooltip service already renders a template from data-tooltip-info, which costs one delegated listener for the page however many attachments the record has. It shows the full name, the size, and a preview: the image itself, or the thumbnail Odoo generated for a PDF. Other file types get no picture, since /web/image would only serve back a mimetype placeholder.
cliffkujala
force-pushed
the
19.0-mail_attach_existing_attachment-foldable-sections
branch
from
August 10, 2026 13:29
02ab09b to
7860c44
Compare
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.





What
The composer lists every attachment already on the record as one long column of checkboxes. On a record with any mail history that column pushes the Send button off screen, and the filenames a mail thread accumulates (
image001.png,image002.png, ...) are impossible to tell apart.This groups the composer's attachments under two foldable headers, using the same
hr/caret header core already uses for Planned Activities:repeat(auto-fill, minmax(min(15rem, 100%), 1fr)), so the column count follows the dialog's own width rather than the viewport's.AttachmentList), instead of the plain list of links Odoo 19 renders. It only appears once there is at least one file.The picker also loads its choices with
search_readrather thanname_search, whose default limit of 100 silently dropped the oldest attachments of a busy record, and shows each file's size.Only the comment-mode composer is touched. Mass mail keeps the stock widget, which is consistent with
can_attach_attachmentalready being False there.Two notes for reviewers:
--fieldWidget-display: block, as core'smail_composer_attachment_listdoes. Without it the field wrapper isinline-block, the header rules have nothing to grow into and the grid cannot get past one column.min()in the grid template is interpolated (#{"min(15rem, 100%)"}), because libsass otherwise evaluates it as a Sass function and fails on comparingremwith%.Test plan
web.assets_backendcompiles with the new SCSS.