[GH-ISSUE #1783] [Feature]: Long-Term Memory: keep the message range visible in Chat messages rows with long chat names #1752

Closed
opened 2026-11-07 16:36:25 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @Promansis on GitHub (Oct 27, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Agents/issues/1783

Originally assigned to: @Promansis on GitHub.

What problem does this solve?

In Sources → Chat messages, each row shows one title line: <chat name>, messages <range>, for example My Long Adventure, messages 241-300. The line is cut with "…" when it doesn't fit. With a long chat name, the cut lands inside the name, so the range is hidden. Every row of one chat then looks the same, and you can't tell which piece is which without opening it. The second line (Import <same title>) is cut the same way, so it doesn't help.

Today:
[ ] My Very Long Adventure With Some Friends In The Ci…  READY
    Import My Very Long Adventure With Some Friends…
[ ] My Very Long Adventure With Some Friends In The Ci…  READY
    Import My Very Long Adventure With Some Friends…

Wanted:
[ ] My Very Long Adventure With So…  messages 1-120    READY
[ ] My Very Long Adventure With So…  messages 121-240  READY

Proposed package or change

Package-only change to Long-Term Memory's Sources workspace. No Engine change.

Chat messages preview samples carry their range as data, and the row renders it as a separate label that never shrinks. Only the chat name gets "…". The title string itself does not change: it is still the source note title, the accessible name and the task-tray title. So no existing source note is renamed or marked as updated.

The label is localized (en and ko), unlike today's server-built English title. A scene name can later use the same slot, if scene-aware pieces land.

Minimal fix

  • Shared packages/long-term-memory/src/engine/packages/shared/src/features/agents/long-term-memory/schema/sources.ts: ltmInteropPreviewSampleBaseSchema (~37) gains an optional messageRange: { chatName: string 1..240, first: int ≥ 1, last: int ≥ first }. It stays .strict().
  • Server packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/sources/interop.ts
    • Candidate (~45) gains an optional messageRange. The chat-messages builder (~670–691, where title is built from chatDisplayName and piece.first/piece.last) sets it.
    • previewSample (~816) copies it into base.
    • No other source type sets it.
  • Client packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/sources/SourcesWorkspace.tsx, renderFlatSourceRow (~1498, title at ~1538):
    • When row.messageRange is set, render <strong className="min-w-0 truncate">{chatName}</strong>, followed by a shrink-0 whitespace-nowrap range label.
    • The title line has to keep a single row with min-w-0 (today it is flex-wrap), so that the name, not the range, is what shrinks.
    • Rows without messageRange render exactly as today.
  • Locales …/client/src/features/long-term-memory/locales/en.json and ko.json: add keys for "message {{value1}}" and "messages {{value1}}–{{value2}}". node scripts/validate-package-locales.mjs must pass.

Regression:

  1. tests/long-term-memory-chat-transcript-import.regression.ts: the existing preview assertion (~218, "Moon Vault, messages 1-4") also expects messageRange: { chatName: "Moon Vault", first: 1, last: 4 }. Add a single-message piece. Chat summary, character and lorebook samples have no messageRange.
  2. tests/long-term-memory-browser.regression.ts: on a Chat messages row with a long chat name at a narrow width, the range label is visible and inside the row's box (its right edge ≤ the row's right edge), and the name element is the one that is cut. A character row's markup is unchanged.

Non-goals

  • The repeated Import <title> second line. It could be dropped or replaced for Chat messages rows, as a separate polish item.
  • Scene names. The slot is ready for them, but scene-aware pieces are not part of this.
  • Any change to the source note title or to import identity.

Why should this be optional?

Long-Term Memory is already a catalog package, and this changes only how its own Sources list lays out one row type.

Alternatives considered

  • Wrap the title instead of cutting it. CSS-only, but rows of long chats grow to two or three lines, and the range is still at the end of a long run of text. Rejected in favour of a pinned label.
  • Put the range first in the title (messages 241-300 · <chat name>). This changes every chat-messages source note title and its English-only wording, and makes the list read range-first. Rejected.
  • Parse the range out of the title in the client. It would avoid the schema field, but it ties the UI to an English display string. Rejected.

Additional context

The other places that show this title already wrap and are fine: the selected-items list (~2789) and the workbench header (~2818).

Template check

  • I DID NOT read this template and provide the requested details.
Originally created by @Promansis on GitHub (Oct 27, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Agents/issues/1783 Originally assigned to: @Promansis on GitHub. ## What problem does this solve? In Sources → Chat messages, each row shows one title line: `<chat name>, messages <range>`, for example `My Long Adventure, messages 241-300`. The line is cut with "…" when it doesn't fit. With a long chat name, the cut lands inside the name, so the range is hidden. Every row of one chat then looks the same, and you can't tell which piece is which without opening it. The second line (`Import <same title>`) is cut the same way, so it doesn't help. ``` Today: [ ] My Very Long Adventure With Some Friends In The Ci… READY Import My Very Long Adventure With Some Friends… [ ] My Very Long Adventure With Some Friends In The Ci… READY Import My Very Long Adventure With Some Friends… Wanted: [ ] My Very Long Adventure With So… messages 1-120 READY [ ] My Very Long Adventure With So… messages 121-240 READY ``` ## Proposed package or change Package-only change to Long-Term Memory's Sources workspace. No Engine change. Chat messages preview samples carry their range as data, and the row renders it as a separate label that never shrinks. Only the chat name gets "…". The title string itself does not change: it is still the source note title, the accessible name and the task-tray title. So no existing source note is renamed or marked as updated. The label is localized (`en` and `ko`), unlike today's server-built English title. A scene name can later use the same slot, if scene-aware pieces land. ### Minimal fix - Shared `packages/long-term-memory/src/engine/packages/shared/src/features/agents/long-term-memory/schema/sources.ts`: `ltmInteropPreviewSampleBaseSchema` (~37) gains an optional `messageRange: { chatName: string 1..240, first: int ≥ 1, last: int ≥ first }`. It stays `.strict()`. - Server `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/sources/interop.ts` - `Candidate` (~45) gains an optional `messageRange`. The chat-messages builder (~670–691, where `title` is built from `chatDisplayName` and `piece.first`/`piece.last`) sets it. - `previewSample` (~816) copies it into `base`. - No other source type sets it. - Client `packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/sources/SourcesWorkspace.tsx`, `renderFlatSourceRow` (~1498, title at ~1538): - When `row.messageRange` is set, render `<strong className="min-w-0 truncate">{chatName}</strong>`, followed by a `shrink-0 whitespace-nowrap` range label. - The title line has to keep a single row with `min-w-0` (today it is `flex-wrap`), so that the name, not the range, is what shrinks. - Rows without `messageRange` render exactly as today. - Locales `…/client/src/features/long-term-memory/locales/en.json` and `ko.json`: add keys for "message {{value1}}" and "messages {{value1}}–{{value2}}". `node scripts/validate-package-locales.mjs` must pass. Regression: 1. `tests/long-term-memory-chat-transcript-import.regression.ts`: the existing preview assertion (~218, "Moon Vault, messages 1-4") also expects `messageRange: { chatName: "Moon Vault", first: 1, last: 4 }`. Add a single-message piece. Chat summary, character and lorebook samples have no `messageRange`. 2. `tests/long-term-memory-browser.regression.ts`: on a Chat messages row with a long chat name at a narrow width, the range label is visible and inside the row's box (its right edge ≤ the row's right edge), and the name element is the one that is cut. A character row's markup is unchanged. ### Non-goals - The repeated `Import <title>` second line. It could be dropped or replaced for Chat messages rows, as a separate polish item. - Scene names. The slot is ready for them, but scene-aware pieces are not part of this. - Any change to the source note title or to import identity. ## Why should this be optional? Long-Term Memory is already a catalog package, and this changes only how its own Sources list lays out one row type. ## Alternatives considered - **Wrap the title instead of cutting it.** CSS-only, but rows of long chats grow to two or three lines, and the range is still at the end of a long run of text. Rejected in favour of a pinned label. - **Put the range first in the title** (`messages 241-300 · <chat name>`). This changes every chat-messages source note title and its English-only wording, and makes the list read range-first. Rejected. - **Parse the range out of the title in the client.** It would avoid the schema field, but it ties the UI to an English display string. Rejected. ## Additional context The other places that show this title already wrap and are fine: the selected-items list (~2789) and the workbench header (~2818). ## Template check - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-11-07 16:36:25 +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-Agents#1752
No description provided.