[PR #7033] [MERGED] fix(chat): Chat Summary ranges fit long message numbers, with quiet borders #7439

Closed
opened 2026-10-23 04:19:47 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/7033
Author: @SpicyMarinara
Created: 10/3/2026
Status: ✅ Merged
Merged: 10/4/2026
Merged by: @SpicyMarinara

Base: staging ← Head: fix/summary-range-selector-7029


📝 Commits (6)

  • d128bf8 fix(chat): give Chat Summary ranges full-width rows and quiet borders
  • b61c8c2 fix(chat): keep Chat Summary ranges steady on phones and slow loads
  • ddf0bbe fix(chat): let a late message count still move an untouched Chat Summary range
  • 32d21e7 Merge remote-tracking branch 'origin/staging' into fix/summary-range-selector-7029
  • 585b854 test(chat): pin the full-width Chat Summary range rows in the summary regression
  • b9db946 docs(changelog): note the Chat Summary range limit on the narrowest phones

📊 Changes

4 files changed (+298 additions, -107 deletions)

View changed files

📝 CHANGELOG.md (+2 -0)
📝 e2e/summary-controls.e2e.ts (+172 -0)
📝 packages/client/src/components/chat/SummaryPopover.tsx (+116 -99)
📝 scripts/regressions/conversation-summary.regression.ts (+8 -8)

📄 Description

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch or a same-repository hotfix/* branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

Closes #7029

Why this change

On desktop, Chat Summary's Range footer had three problems:

  • It squeezed each range into half the footer.
  • Its number fields cut "559" and "679" down to "55" and "67".
  • It outlined an invalid range in the accent colour, which pulses.

The pulse comes from the invalid style using --destructive, which is var(--primary). Accent Pulse, on by default on desktop, cycles --primary every 500 ms.

There was also a false warning. Range mode remembers one range app-wide, so a range picked in a longer chat opened pre-filled in a shorter one. It showed "This range is outside the chat history." right away and still counted "121 messages selected".

What changed

  • Layout: one full-width row per range (number, From, dash, To, status, ×). The list grows with Add range up to min(16rem, 30dvh), so short windows keep room above the footer.
  • Number fields: w-[5.5rem] fits five digits on desktop. Below sm, the native stepper is hidden (the pattern InlineControls already uses), so four digits fit at 320px and five at 360px. Every row has one fixed status slot, so fields don't shift as a run progresses.
  • Quiet styling: the range box always uses --border, like the other sections. An invalid range shows an amber warning icon, amber text and amber field rings with aria-invalid, the same as an overlapping range already did. Nothing pulses.
  • Remembered range: a remembered range is used only if it fits this chat; otherwise the range starts on the latest messages, like Last mode. It waits for a slow message count instead of being dropped, and never overrides a range you've edited.
  • Header count: an invalid range no longer counts as "messages selected".
  • Tests: e2e/summary-controls.e2e.ts covers full width, a 4-digit value fully visible, the neutral border, the remembered-range cases (including a late message count) and the "0 messages selected" header. Each fails before the fix.
  • CHANGELOG: one entry.
  • Slow loads and mode switches (review follow-up):
    • Switching Last → Range always starts on the Last window, whether or not the message count has loaded. If it hasn't, the remembered range is cleared instead of saving the first page's numbers.
    • Clicking into a range field and leaving it unchanged no longer counts as an edit, so a late message count still updates it.
    • Each case has an e2e test that fails without its fix.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Manual verification notes

Run by the agent:

  • pnpm check and pnpm localization:check pass.
  • e2e/summary-controls.e2e.ts on desktop-chromium, mobile-chromium and mobile-webkit: 13 passed and 2 skipped. The skips are the phone-keyboard tests on desktop, by design. The two range tests passed 18/18 across three repeats on all three projects.
  • #7025's phone-keyboard tests still pass.
  • An adversarial review found five low-severity problems, all fixed with before/after proof:
    • fields shifting on phones;
    • digits cut off at 320px;
    • a cramped footer on short windows;
    • a late message count dropping the remembered range;
    • the header counting an invalid range.
  • The before/after screenshots covered desktop at 1440 and 900, phones at 390/393 and 320, light and dark.

Known limit: five digits at 320px still don't fit. That needs a chat over 9,999 messages on a 320px screen. It's marked with a ponytail: comment.

Still to verify by hand:

  • Throttle the network on a long chat, open Chat Summary in Last, and switch to Range before it loads. Once loaded it shows the chat's latest messages, the same as switching after it loads.

  • Throttle again, click into a range field without typing, and click away after the chat loads. The range updates to match the loaded chat.

  • On desktop, in a long Roleplay chat, open Chat Summary, choose Range, and enter 4-digit numbers. The row spans the footer, every digit shows, and the border matches the other sections with Accent Pulse on.

  • Open Chat Summary in a short chat after using Range in a long one. No "outside the chat history" warning appears.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)

CHANGELOG updated; no user docs change.

Summary by CodeRabbit

  • New Features

    • Batch ranges appear in a compact, vertically scrollable layout with wider fields for message numbers.
    • Out-of-history ranges show a warning and are excluded from the selected-message count.
    • Range details show the total number of messages inspected across all batches.
  • Bug Fixes

    • Range selection follows the current chat’s message count until edited, starts at the latest messages, and ignores remembered ranges beyond chat history.
    • Choosing Range or focusing a field before a long chat finishes loading no longer leaves the selection stuck on the first messages.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/7033 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 10/3/2026 **Status:** ✅ Merged **Merged:** 10/4/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/summary-range-selector-7029` --- ### 📝 Commits (6) - [`d128bf8`](https://github.com/Pasta-Devs/Marinara-Engine/commit/d128bf8f40352236ddceed3f0c0c3c3a2895c3db) fix(chat): give Chat Summary ranges full-width rows and quiet borders - [`b61c8c2`](https://github.com/Pasta-Devs/Marinara-Engine/commit/b61c8c2584ee28784897d30bb71e64b544f54d98) fix(chat): keep Chat Summary ranges steady on phones and slow loads - [`ddf0bbe`](https://github.com/Pasta-Devs/Marinara-Engine/commit/ddf0bbe0255c86aad6efa09e00d5f2e83c343dea) fix(chat): let a late message count still move an untouched Chat Summary range - [`32d21e7`](https://github.com/Pasta-Devs/Marinara-Engine/commit/32d21e7595ec2466b2ca63a9c5a22d1f9fe2aa72) Merge remote-tracking branch 'origin/staging' into fix/summary-range-selector-7029 - [`585b854`](https://github.com/Pasta-Devs/Marinara-Engine/commit/585b854faa02a3f5b6a73fe67fbb4f4e03577b13) test(chat): pin the full-width Chat Summary range rows in the summary regression - [`b9db946`](https://github.com/Pasta-Devs/Marinara-Engine/commit/b9db9462fd573fdd730c01a05b77ee94533e6fd5) docs(changelog): note the Chat Summary range limit on the narrowest phones ### 📊 Changes **4 files changed** (+298 additions, -107 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+2 -0) 📝 `e2e/summary-controls.e2e.ts` (+172 -0) 📝 `packages/client/src/components/chat/SummaryPopover.tsx` (+116 -99) 📝 `scripts/regressions/conversation-summary.regression.ts` (+8 -8) </details> ### 📄 Description > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch or a same-repository `hotfix/*` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. ## Linked issue Closes #7029 ## Why this change On desktop, Chat Summary's Range footer had three problems: - It squeezed each range into half the footer. - Its number fields cut "559" and "679" down to "55" and "67". - It outlined an invalid range in the accent colour, which pulses. The pulse comes from the invalid style using `--destructive`, which is `var(--primary)`. Accent Pulse, on by default on desktop, cycles `--primary` every 500 ms. There was also a false warning. Range mode remembers one range app-wide, so a range picked in a longer chat opened pre-filled in a shorter one. It showed "This range is outside the chat history." right away and still counted "121 messages selected". ## What changed - **Layout:** one full-width row per range (number, From, dash, To, status, ×). The list grows with **Add range** up to `min(16rem, 30dvh)`, so short windows keep room above the footer. - **Number fields:** `w-[5.5rem]` fits five digits on desktop. Below `sm`, the native stepper is hidden (the pattern `InlineControls` already uses), so four digits fit at 320px and five at 360px. Every row has one fixed status slot, so fields don't shift as a run progresses. - **Quiet styling:** the range box always uses `--border`, like the other sections. An invalid range shows an amber warning icon, amber text and amber field rings with `aria-invalid`, the same as an overlapping range already did. Nothing pulses. - **Remembered range:** a remembered range is used only if it fits this chat; otherwise the range starts on the latest messages, like Last mode. It waits for a slow message count instead of being dropped, and never overrides a range you've edited. - **Header count:** an invalid range no longer counts as "messages selected". - **Tests:** `e2e/summary-controls.e2e.ts` covers full width, a 4-digit value fully visible, the neutral border, the remembered-range cases (including a late message count) and the "0 messages selected" header. Each fails before the fix. - **CHANGELOG:** one entry. - **Slow loads and mode switches (review follow-up):** - Switching Last → Range always starts on the Last window, whether or not the message count has loaded. If it hasn't, the remembered range is cleared instead of saving the first page's numbers. - Clicking into a range field and leaving it unchanged no longer counts as an edit, so a late message count still updates it. - Each case has an e2e test that fails without its fix. ## Validation - [ ] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [ ] Read and followed `CONTRIBUTING.md` ### Manual verification notes Run by the agent: - `pnpm check` and `pnpm localization:check` pass. - `e2e/summary-controls.e2e.ts` on desktop-chromium, mobile-chromium and mobile-webkit: 13 passed and 2 skipped. The skips are the phone-keyboard tests on desktop, by design. The two range tests passed 18/18 across three repeats on all three projects. - #7025's phone-keyboard tests still pass. - An adversarial review found five low-severity problems, all fixed with before/after proof: - fields shifting on phones; - digits cut off at 320px; - a cramped footer on short windows; - a late message count dropping the remembered range; - the header counting an invalid range. - The before/after screenshots covered desktop at 1440 and 900, phones at 390/393 and 320, light and dark. Known limit: five digits at 320px still don't fit. That needs a chat over 9,999 messages on a 320px screen. It's marked with a `ponytail:` comment. Still to verify by hand: - Throttle the network on a long chat, open Chat Summary in Last, and switch to Range before it loads. Once loaded it shows the chat's latest messages, the same as switching after it loads. - Throttle again, click into a range field without typing, and click away after the chat loads. The range updates to match the loaded chat. - On desktop, in a long Roleplay chat, open **Chat Summary**, choose **Range**, and enter 4-digit numbers. The row spans the footer, every digit shows, and the border matches the other sections with Accent Pulse on. - Open Chat Summary in a short chat after using Range in a long one. No "outside the chat history" warning appears. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) CHANGELOG updated; no user docs change. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Batch ranges appear in a compact, vertically scrollable layout with wider fields for message numbers. * Out-of-history ranges show a warning and are excluded from the selected-message count. * Range details show the total number of messages inspected across all batches. * **Bug Fixes** * Range selection follows the current chat’s message count until edited, starts at the latest messages, and ignores remembered ranges beyond chat history. * Choosing Range or focusing a field before a long chat finishes loading no longer leaves the selection stuck on the first messages. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-23 04:19:47 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#7439
No description provided.