Skip to content

fix(app): show all update notice bullets - #372

Merged
Astro-Han merged 3 commits into
devfrom
codex/fix-i309-update-notice
May 2, 2026
Merged

fix(app): show all update notice bullets#372
Astro-Han merged 3 commits into
devfrom
codex/fix-i309-update-notice

Conversation

@Astro-Han

@Astro-Han Astro-Han commented May 2, 2026

Copy link
Copy Markdown
Owner

Summary

Parse every bullet in the app update notice into its own release highlight instead of collapsing the notice to the first non-heading line.

Why

Chinese release notes already route through ## 中文版本 and ### 主要更新, but the parser only returned the first parsed line. For v2026.4.29, that meant the in-app update dialog showed a single Chinese item while the release body had multiple user-facing updates.

Related Issue

Fixes #309.

Human Review Status

Pending. A human should make the final merge decision after reviewing the final diff and verification evidence.

Review Focus

Please check the parser contract: bullet notices now become multiple cards, while one-paragraph notices still stay as a single card.

Risk Notes

Low app-side parser change. The dialog already supports multiple highlights. This removes the old five-item cap so a skipped-version update can show the full parsed notice range.

How To Verify

Focused regression test: bun test --preload ./happydom.ts ./src/context/highlights.test.ts -> 12 pass, 0 fail
App typecheck: bun --cwd packages/app typecheck -> exit 0
Live release parse check: v2026.4.29 zh update notice -> 9 parsed items

Screenshots or Recordings

Not included. This changes parser output covered by unit tests; no new UI layout was introduced.

Checklist

  • Human review status is stated above as pending, approved, or not required
  • I linked the related issue, or stated why there is no issue
  • This PR has type, scope, and priority labels, or I requested maintainer labeling
  • I described the review focus and any meaningful risks
  • I listed the relevant verification steps and the key result for each
  • I did not introduce unrelated refactors, dependencies, generated files, or file changes beyond the stated scope
  • I manually checked visible UI or copy changes when needed, with screenshots or recordings
  • I considered macOS and Windows impact for desktop, packaging, updater, signing, paths, shell, or permissions changes
  • I called out docs, release notes, dependencies, permissions, credentials, deletion behavior, generated content, or local file changes when relevant
  • I reviewed the final diff for unrelated changes and suspicious dependency changes
  • I am targeting dev, and my PR title and commit messages use Conventional Commits in English

Summary by CodeRabbit

  • Tests

    • Expanded tests for release highlight parsing across locales, verifying multiple extracted bullets, preserved hard-wrapped paragraphs, and selection behavior across skipped versions.
  • Improvements

    • Highlights now surface multiple localized update-notice bullets (better Chinese handling), treat wrapped paragraphs as single cards, split numbered/bulleted lines into separate highlights, trim/truncate items, and raise the displayed highlight cap to 15 with sensible limits for long skipped-version ranges.

@coderabbitai

coderabbitai Bot commented May 2, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 0c693e77-7a0f-4820-850d-14cf42a4649d

📥 Commits

Reviewing files that changed from the base of the PR and between 8864472 and 1afe5ea.

📒 Files selected for processing (2)
  • packages/app/src/context/highlights.test.ts
  • packages/app/src/context/highlights.tsx
✅ Files skipped from review due to trivial changes (1)
  • packages/app/src/context/highlights.test.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/app/src/context/highlights.tsx

📝 Walkthrough

Walkthrough

Release-note parsing now extracts multiple bullet/numbered items from localized "App Update Notice" sections (zh targets 主要更新 within 中文版本) and emits one highlight per item; items are trimmed/truncated (200 chars), deduplicated, and the final highlights list is capped at 15.

Changes

Release Body Parsing & Highlight Generation

Layer / File(s) Summary
Data / Constants
packages/app/src/context/highlights.tsx
Added MAX_RELEASE_HIGHLIGHTS = 15.
Parsing Helpers
packages/app/src/context/highlights.tsx
Introduced trimNoticeItem, parseNoticeDescriptions, and parseReleaseBodyDescriptions to split bullet/numbered lines, append continuation lines, and truncate items to 200 chars; fallback to a single joined truncated summary when no bullets are found.
Locale Targeting
packages/app/src/context/highlights.tsx
For zh targets the 主要更新 subsection inside 中文版本 (with fallback to full 中文版本); for other locales targets App Update Notice.
Highlight Generation
packages/app/src/context/highlights.tsx (parseRelease)
Maps each parsed description string to an individual highlight { title, description } instead of producing a single summary string.
Deduplication / Slicing
packages/app/src/context/highlights.tsx (sliceHighlights)
Deduplicates as before but now returns unique.slice(0, MAX_RELEASE_HIGHLIGHTS) (cap 15).
Tests / Validation
packages/app/src/context/highlights.test.ts
Updated zh-locale tests to expect multiple ordered bullet highlights and added tests for hard-wrapped paragraph merging, wrapped-bullet continuation preservation, full preservation of long Chinese bullet lists in mixed content, and skipped-version highlight retention/upper-bound limiting behavior.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related issues

  • #309 — Direct match: fixes the bug where only the first Chinese 主要更新 bullet was shown by extracting multiple items.
  • #163 — Related: extends localized "App Update Notice" handling and ensures multiple localized bullets are preserved.

Possibly related PRs

  • #153 — Modifies the same release-note parsing area (highlights.tsx / tests) and targeted the "App Update Notice" section; this PR extends that parsing to produce multiple localized items.

Poem

🐰
I hop through lines and nibble flakes of text,
Bullets bloom into cards, none left unvexed;
Chinese items split and take their place,
Fifteen at most — a tidy space;
I dance, I chew, hooray for parsed specs.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: parsing every bullet in the app update notice instead of showing just the first one.
Description check ✅ Passed The PR description is comprehensive, covering summary, rationale, related issue, review focus, risk assessment, verification steps, and all checklist items completed.
Linked Issues check ✅ Passed The code changes directly implement the objectives from issue #309: parsing multiple bullets from localized release notes and returning each as a separate highlight instead of collapsing to the first item.
Out of Scope Changes check ✅ Passed All changes are scoped to the release-note parser logic and related tests, directly addressing the issue of displaying multi-bullet update notices without unrelated refactors or dependencies.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/fix-i309-update-notice

Review rate limit: 9/10 reviews remaining, refill in 6 minutes.

Comment @coderabbitai help to get the list of available commands and usage tips.

@Astro-Han Astro-Han added bug Something isn't working app Application behavior and product flows P2 Medium priority labels May 2, 2026

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request updates the release highlight logic to extract and display all bullet points from release notes instead of just the first one. It introduces a new parsing function to handle multiple descriptions and updates the test suite to reflect these changes. A review comment points out that removing the limit on the number of highlights could lead to UI overflow and poor user experience in the release notes dialog, suggesting a reasonable upper limit of 15 highlights be maintained.

Comment thread packages/app/src/context/highlights.tsx Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
packages/app/src/context/highlights.test.ts (1)

96-131: ⚡ Quick win

Add a skipped-version regression for the removed highlight cap.

These assertions prove one release can emit many cards, but they never exercise the sliceHighlights change that removed the old 5-item limit across a release range. A multi-release payload with more than five total highlights would catch the exact skipped-version case this PR is targeting.

Suggested test shape
+  test("keeps more than five highlights across skipped versions", () => {
+    const payload = [
+      {
+        tag_name: "v2026.4.29",
+        body: "## App Update Notice\n\n- A\n- B\n- C\n",
+      },
+      {
+        tag_name: "v2026.4.28",
+        body: "## App Update Notice\n\n- D\n- E\n- F\n",
+      },
+    ]
+
+    expect(loadReleaseHighlights(payload, "2026.4.29", "2026.4.27", "en")).toHaveLength(6)
+  })
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/app/src/context/highlights.test.ts` around lines 96 - 131, The test
currently validates localized bullets for a single release but doesn't exercise
the multi-release path and the removed 5-item cap in sliceHighlights; extend or
add a test that calls loadReleaseHighlights with a payload containing multiple
releases (e.g., v2026.4.27, v2026.4.28, v2026.4.29) whose combined highlights
exceed five items, request a range that spans them (start version earlier than
the oldest and end version equal to latest) and assert that the returned
highlights (from loadReleaseHighlights) include all items across releases (no
slicing to 5), thus validating the sliceHighlights behavior for skipped-version
scenarios.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/app/src/context/highlights.tsx`:
- Around line 96-112: parseNoticeDescriptions currently returns only lines[0]
for non-bulleted notices, which drops wrapped paragraphs; change the non-bullet
fallback to join the filtered lines into a single paragraph before trimming so a
wrapped paragraph becomes one card. Locate parseNoticeDescriptions and replace
the final return that uses lines[0] with logic that joins lines (e.g.,
lines.join(' ')), then call trimNoticeItem on that joined string (use the
existing trimNoticeItem helper) and return it as the single-element array if
non-empty.

---

Nitpick comments:
In `@packages/app/src/context/highlights.test.ts`:
- Around line 96-131: The test currently validates localized bullets for a
single release but doesn't exercise the multi-release path and the removed
5-item cap in sliceHighlights; extend or add a test that calls
loadReleaseHighlights with a payload containing multiple releases (e.g.,
v2026.4.27, v2026.4.28, v2026.4.29) whose combined highlights exceed five items,
request a range that spans them (start version earlier than the oldest and end
version equal to latest) and assert that the returned highlights (from
loadReleaseHighlights) include all items across releases (no slicing to 5), thus
validating the sliceHighlights behavior for skipped-version scenarios.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: d6e5008f-f648-4dc5-a30e-13231dd5dac8

📥 Commits

Reviewing files that changed from the base of the PR and between 2bfb2c0 and 2ab9eae.

📒 Files selected for processing (2)
  • packages/app/src/context/highlights.test.ts
  • packages/app/src/context/highlights.tsx

Comment thread packages/app/src/context/highlights.tsx Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/app/src/context/highlights.tsx`:
- Around line 105-111: The current bullets extraction treats each physical line
separately (in the block that builds bullets from lines and uses match and
trimNoticeItem), which truncates wrapped markdown bullet continuations; fix by
iterating through lines and when you find a bullet start (the existing regex
match in the bullets creation), accumulate that line plus any immediately
following lines that are continuation lines (e.g., lines that are indented or do
not start with a list marker) into a single string, then call trimNoticeItem on
the combined string and push that single item to bullets; update the logic
around the variables lines, bullets, and the match handling to skip consumed
continuation lines so you don’t double-process them.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 52c69f13-df4e-4c13-9569-eac133ce14d4

📥 Commits

Reviewing files that changed from the base of the PR and between 2ab9eae and 8864472.

📒 Files selected for processing (2)
  • packages/app/src/context/highlights.test.ts
  • packages/app/src/context/highlights.tsx

Comment thread packages/app/src/context/highlights.tsx Outdated
@Astro-Han
Astro-Han merged commit 61c5ac0 into dev May 2, 2026
27 checks passed
@Astro-Han
Astro-Han deleted the codex/fix-i309-update-notice branch May 2, 2026 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app Application behavior and product flows bug Something isn't working P2 Medium priority

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Chinese update notice only shows the first item

1 participant