Skip to content

Commit 3b09e55

Browse files
fix(tools): count important commits against the changelog fold limit
The fold limit only sliced normal commits, so important commits rendered above the fold without consuming any of the budget. A section with 4 important commits and a limit of 5 showed all 5 normal commits too (9 total) and never emitted the Show all details block. Subtract the important count from the limit so it caps total above-fold items, clamped at 0 so important commits are still never collapsed when they alone meet or exceed the limit.
1 parent 0e59278 commit 3b09e55

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

tools/changelog_template.md.j2

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,9 @@
4242
{% else %}
4343
{% set important = sections[change_key] | selectattr("important") | list %}
4444
{% set normal = sections[change_key] | rejectattr("important") | list %}
45-
{% set above_fold = normal[:fold_limit] %}
46-
{% set collapsed = normal[fold_limit:] %}
45+
{% set normal_slots = [fold_limit - (important | length), 0] | max %}
46+
{% set above_fold = normal[:normal_slots] %}
47+
{% set collapsed = normal[normal_slots:] %}
4748
{% for change in important %}{{ render_commit(change) }}{% endfor %}
4849
{% for change in above_fold %}{{ render_commit(change) }}{% endfor %}
4950
{% if collapsed %}

0 commit comments

Comments
 (0)