Skip to content

feat: collapse quoted reply text#1612

Open
Shabhareash wants to merge 1 commit into
floatpane:release/v1from
Shabhareash:feature-collapse-quoted-text
Open

feat: collapse quoted reply text#1612
Shabhareash wants to merge 1 commit into
floatpane:release/v1from
Shabhareash:feature-collapse-quoted-text

Conversation

@Shabhareash

@Shabhareash Shabhareash commented Jun 22, 2026

Copy link
Copy Markdown

What?

Detect quoted/reply blocks (styled in rounded-border boxes) and collapse them into a single '▶ quoted text hidden' indicator by default. Pressing 'q' (configurable via toggle_quotes keybind) expands/collapses the quoted sections.

Changes:

  • view/html.go: add CollapseQuotedText() that identifies rendered quote boxes by their ╭/╰ border chars and replaces them with a one-line summary
  • tui/email_view.go: add showQuotedText toggle, collapse quotes by default, re-render body on toggle; add 'q: toggle quotes' to help bar
  • config: add toggle_quotes keybind (default: q) to EmailKeys

Why?

Closes #1598

@Shabhareash Shabhareash requested a review from a team as a code owner June 22, 2026 21:32

@floatpanebot floatpanebot left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hi @Shabhareash! Please fix the following issues with your PR:

  • Title: Is too long (54 characters). The PR title must be strictly under 40 characters.

@floatpanebot floatpanebot added area/tui Terminal UI / view layer area/config Configuration / settings enhancement New feature or request question Further information requested size/M Diff: 51–200 lines labels Jun 22, 2026
@floatpanebot

Copy link
Copy Markdown
Member

Benchmark report — no significant change

Metrics worse: 0 · better: 0 (threshold: ±3%).

benchstat output
goos: linux
goarch: amd64
pkg: github.com/floatpane/matcha/backend
cpu: AMD EPYC 7763 64-Core Processor                
                           │    old.txt    │               new.txt                │
                           │    sec/op     │    sec/op      vs base               │
ParseSearchQuery_Simple-4    3.772µ ± 304%   3.208µ ± 120%        ~ (p=0.310 n=6)
ParseSearchQuery_Complex-4   5.587µ ±  67%   9.161µ ±  41%        ~ (p=0.132 n=6)
TokenizeSearchQuery-4        5.280µ ±  41%   6.973µ ±  56%        ~ (p=0.485 n=6)
geomean                      4.810µ          5.895µ         +22.57%

                           │  old.txt   │              new.txt               │
                           │    B/op    │    B/op     vs base                │
ParseSearchQuery_Simple-4    26.00 ± 0%   26.00 ± 0%       ~ (p=1.000 n=6) ¹
ParseSearchQuery_Complex-4   762.0 ± 0%   762.0 ± 0%       ~ (p=1.000 n=6) ¹
TokenizeSearchQuery-4        176.0 ± 0%   176.0 ± 0%       ~ (p=1.000 n=6) ¹
geomean                      151.6        151.6       +0.00%
¹ all samples are equal

                           │  old.txt   │              new.txt               │
                           │ allocs/op  │ allocs/op   vs base                │
ParseSearchQuery_Simple-4    2.000 ± 0%   2.000 ± 0%       ~ (p=1.000 n=6) ¹
ParseSearchQuery_Complex-4   23.00 ± 0%   23.00 ± 0%       ~ (p=1.000 n=6) ¹
TokenizeSearchQuery-4        9.000 ± 0%   9.000 ± 0%       ~ (p=1.000 n=6) ¹
geomean                      7.453        7.453       +0.00%
¹ all samples are equal

pkg: github.com/floatpane/matcha/tui
                    │   old.txt    │               new.txt               │
                    │    sec/op    │    sec/op      vs base              │
LogPanelView-4        173.2µ ± 20%    161.8µ ±  8%  -6.58% (p=0.041 n=6)
SearchOverlayView-4   197.0µ ± 14%    175.7µ ±  7%       ~ (p=0.065 n=6)
InboxConstruction-4   997.7µ ± 17%   1030.1µ ± 33%       ~ (p=0.937 n=6)
geomean               324.1µ          308.3µ        -4.89%

                    │    old.txt    │               new.txt               │
                    │     B/op      │     B/op       vs base              │
LogPanelView-4        44.67Ki ± 51%   44.67Ki ± 51%       ~ (p=1.000 n=6)
SearchOverlayView-4   56.14Ki ± 41%   44.66Ki ± 26%       ~ (p=0.359 n=6)
InboxConstruction-4   874.3Ki ±  0%   874.3Ki ±  0%       ~ (p=0.734 n=6)
geomean               129.9Ki         120.4Ki        -7.34%

                    │   old.txt   │              new.txt              │
                    │  allocs/op  │  allocs/op   vs base              │
LogPanelView-4         714.0 ± 0%    714.0 ± 0%       ~ (p=1.000 n=6)
SearchOverlayView-4    926.0 ± 0%    925.0 ± 0%       ~ (p=0.545 n=6)
InboxConstruction-4   3.478k ± 0%   3.478k ± 0%       ~ (p=0.316 n=6)
geomean               1.320k        1.319k       -0.03%

auto-generated by benchmarks.yml

@Shabhareash Shabhareash changed the title feat: collapse quoted reply text behind toggle (q key) feat: collapse quoted reply text Jun 22, 2026
@floatpanebot floatpanebot dismissed their stale review June 22, 2026 21:36

Formatting issues have been resolved. Thank you!

@andrinoff

Copy link
Copy Markdown
Member

@Shabhareash this feature is supposed to go to release/v1 branch, please, rebase this PR on release/v1 branch. You can checkout to release/v1, cherry-pick the commit, resolve the conflicts if needed and force push to this branch (please, note, that you need to change target on this PR, you need to edit the title and underneath change master to release/v1)

Detect quoted/reply blocks (styled in rounded-border boxes) and collapse
them into a single '▶ quoted text hidden' indicator by default. Pressing
'q' (configurable via toggle_quotes keybind) expands/collapses the quoted
sections.

Changes:
- view/html.go: add CollapseQuotedText() that identifies rendered quote
  boxes by their ╭/╰ border chars and replaces them with a one-line summary
- tui/email_view.go: add showQuotedText toggle, collapse quotes by default,
  re-render body on toggle; add 'q: toggle quotes' to help bar
- config: add toggle_quotes keybind (default: q) to EmailKeys

Closes floatpane#1612
@Shabhareash Shabhareash force-pushed the feature-collapse-quoted-text branch from 3c7f428 to 98f7b27 Compare June 23, 2026 13:42
@floatpanebot floatpanebot added the size/XL Diff: 800+ lines label Jun 23, 2026
@floatpanebot

Copy link
Copy Markdown
Member

This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size.

@floatpanebot floatpanebot added dependencies Dependency updates ci CI / build pipeline area/fetcher IMAP fetch / IDLE / search area/sender SMTP send path area/oauth OAuth / XOAUTH2 / auth flows area/pgp PGP / encryption area/i18n Localization / translations area/cli CLI flags / commands area/daemon Daemon / RPC area/scard Smart card / PKCS#11 area/nix Nix flake / packaging area/build Build system / Makefile / packaging area/docs Docs site / README labels Jun 23, 2026
@Shabhareash Shabhareash changed the base branch from master to release/v1 June 23, 2026 13:44
@floatpanebot floatpanebot added the target/v1 PR targets the release/v1 branch directly label Jun 23, 2026
@andrinoff andrinoff added area/config Configuration / settings and removed area/build Build system / Makefile / packaging area/cli CLI flags / commands area/config Configuration / settings area/daemon Daemon / RPC size/XL Diff: 800+ lines question Further information requested ci CI / build pipeline dependencies Dependency updates area/docs Docs site / README area/fetcher IMAP fetch / IDLE / search area/i18n Localization / translations area/nix Nix flake / packaging area/oauth OAuth / XOAUTH2 / auth flows area/pgp PGP / encryption area/scard Smart card / PKCS#11 area/sender SMTP send path labels Jun 23, 2026

@andrinoff andrinoff left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

  1. q is definitely taken by q(uit) (hardcoded), lets choose a different default keybind

  2. The key help is written (i like the one that is in the email more)

Image
  1. Should be a new line, and not spaced out (word wrapped)
Image
  1. I think an email should be there, empty instead
Image
  1. Wednesday is not with the date,
Image
  1. Name is trailing, i think you can make it from Name (address@email.com)
Image

Also, if you could add it to command palette, that would be great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/config Configuration / settings area/tui Terminal UI / view layer enhancement New feature or request size/M Diff: 51–200 lines target/v1 PR targets the release/v1 branch directly

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FEAT: Collapse quoted reply text in message view

3 participants