Skip to content

Conversation

@pamburus
Copy link
Owner

@pamburus pamburus commented Jun 29, 2024

Description

This pull request adds the ability to expand fields and messages.

  -x, --expansion <MODE>      Whether to expand fields and messages [env: HL_EXPANSION=] [default: medium] [possible values: never, inline, low, medium, high, always]
  • Expansion mode never completely disables field expansion, even if multiline fields are found.
  • Expansion mode inline expands only multi-line fields as-is (inline) without any prefixes or formatting.
  • Expansion mode low uses low expansion settings profile, which minimizes expansion.
  • Expansion mode medium uses medium expansion settings profile, which provides an optimal balance between readability and density.
  • Expansion mode high uses high expansion settings profile, which shifts the balance towards readability.
  • Expansion mode always expands every field regardless of its value and expands the message if it is multiline.

The default mode is now medium. To keep the old behavior, use the inline mode.

Demo

expansion

@codecov
Copy link

codecov bot commented Jun 29, 2024

Codecov Report

❌ Patch coverage is 98.31508% with 20 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.34%. Comparing base (bc8f860) to head (9c9e4fb).

Files with missing lines Patch % Lines
src/formatting.rs 98.67% 10 Missing ⚠️
src/cli.rs 82.35% 6 Missing ⚠️
crate/mline/src/lib.rs 99.20% 2 Missing ⚠️
src/model.rs 89.47% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #320      +/-   ##
==========================================
+ Coverage   86.38%   87.34%   +0.95%     
==========================================
  Files          61       62       +1     
  Lines       10497    11425     +928     
==========================================
+ Hits         9068     9979     +911     
- Misses       1429     1446      +17     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@pamburus pamburus marked this pull request as ready for review June 29, 2024 21:57
@pamburus pamburus changed the title new: Fields and message expansion feature feat: fields and message expansion feature Aug 13, 2024
@pamburus pamburus force-pushed the feature/expansion branch 2 times, most recently from 2261945 to df95c31 Compare December 21, 2024 19:27
@pamburus pamburus force-pushed the feature/expansion branch 3 times, most recently from 926ce87 to 5e62dee Compare January 13, 2025 22:00
@pamburus pamburus marked this pull request as draft September 14, 2025 04:46
@pamburus pamburus added the enhancement New feature or request label Oct 5, 2025
@zx8
Copy link

zx8 commented Oct 17, 2025

This feature looks incredible! Is there any ETA on it landing?

Keep up the great work.

@pamburus
Copy link
Owner Author

@zx8
Thanks! There is no ETA on this yet.
I thought this feature was almost ready, but it turned out to be more complex than I initially expected, and some of the decisions made here are quite controversial. There are unneeded complications in the codebase, as well as new, subtle bugs.
I decided to postpone it a bit because I hope to finish another huge refactoring soon. That will help make the implementation of this feature less messy.
I will probably split this feature into two parts. I am also thinking about delivering less heuristic-based code in the first batch, since it is the most controversial and complicated to implement, and it requires a lot of advanced configuration for fine-tuning.

@pamburus pamburus force-pushed the feature/expansion branch 6 times, most recently from 38777b9 to 7762402 Compare December 15, 2025 00:33
@pamburus
Copy link
Owner Author

@zx8
Take a look at #1259. It provides a simplified version of the feature with the most essential parts. This has been merged into master and is available in the latest build.

Could you review it and see if it meets your needs?

@zx8
Copy link

zx8 commented Jan 11, 2026

I've already updated and tried it out - it's fantastic, thank you!

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants