Skip to content

feat(detail): collapse attachments when count exceeds 2#54

Merged
bartekmp merged 4 commits into
mainfrom
claude/email-attachments-collapse-okwZF
Jun 3, 2026
Merged

feat(detail): collapse attachments when count exceeds 2#54
bartekmp merged 4 commits into
mainfrom
claude/email-attachments-collapse-okwZF

Conversation

@bartekmp

@bartekmp bartekmp commented Jun 3, 2026

Copy link
Copy Markdown
Owner

Summary

  • When an email has more than 2 attachments, replaces the flat list with a collapsed summary row showing the attachment count and up to 3 file-type chips (e.g. PDF, PNG, DOCX) sorted by frequency
  • Clicking the summary row expands a fixed-height (160 px) scrollable list of all attachment items — same download behaviour as before
  • Clicking the summary again collapses the list; chevron animates between ▶ (collapsed) and ▼ (expanded)
  • Emails with ≤ 2 attachments are unaffected

Test plan

  • Open an email with 1–2 attachments → flat list renders as before, no summary row
  • Open an email with 3+ attachments → summary row shows count + type chips, list is hidden
  • Click summary row → list expands, chevron points down, aria-expanded becomes true
  • Scroll within the expanded list when there are many attachments (max-height 160 px)
  • Click a file in the expanded list → download triggers correctly
  • Click summary row again → list collapses, chevron points right
  • Verify type chips reflect the most common extensions (e.g. 3 PDFs + 1 PNG → PDF chip first)

https://claude.ai/code/session_011k8zuM3FhFRooN1fpGYhNi


Generated by Claude Code

claude added 2 commits June 3, 2026 08:05
When an email has more than 2 attachments, replace the flat list with a
summary row showing the count and up to 3 file-type chips. Clicking the
row toggles a fixed-height (160 px) scrollable list of all attachment
items; clicking again collapses it.

https://claude.ai/code/session_011k8zuM3FhFRooN1fpGYhNi

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds a collapsed/expandable attachments UI in the email detail view when an email has more than two attachments, while keeping the existing flat list behavior for 1–2 attachments.

Changes:

  • Refactors attachment row creation into a helper and introduces a collapsible “attachment summary” row for 3+ attachments.
  • Adds new CSS for the attachment summary row, type chips, chevron animation, and a max-height scrollable expanded list.
  • Updates package-lock.json with platform-metadata changes (unrelated to the UI feature).

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.

File Description
src/popup/popup.css Adds styling for the new attachment summary row, type chips, chevron, and scrollable expanded list.
src/popup/detail.js Implements the collapsed/expandable attachment list behavior and extracts attachment item rendering into a helper.
package-lock.json Removes libc metadata from several Rollup platform optional packages (scope unrelated to this feature).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@bartekmp bartekmp merged commit f7d5468 into main Jun 3, 2026
1 check passed
@bartekmp bartekmp deleted the claude/email-attachments-collapse-okwZF branch June 3, 2026 08:41
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.

3 participants