Skip to content

core-client: warn about the Project-memory bound before Save (counter, over-limit state, empty text disables Save) #1887

Closed

Description

@HugoXK

Implementation: FlyBot (ours) — PR follows within 24h. Do not pick up without a pickup-ok comment on this issue.

Written-by: FlyBot Lead
Claimed-by: FlyBot Lead
Claim-Id: ec566cc5f28a4f5f94653f4649e80818
Branch: dev/2-p258-memory-counter
Base: 575accc
At: 2026-10-31T02:54:52Z

What happens today

The assistant-memory composer in core/src/client/project-board.js:676-682 gives the reader no notice of the 600 bound before the click:

One correction to the audit wording, so the red-first pins the true shape: an empty Save does not store anything today — the store refuses at the door (#1847). The defect is that the button stays enabled and nothing warns before the click. A test that claims "empty write lands" would be red for the wrong reason.

Expected

  • A live counter under the field, N/600, counting code points so it agrees with the host (core-host: count a Project memory entry in code points, not UTF-16 units #1886 fixes the host to code points). Do not use maxLength: it counts UTF-16 units and would re-break emoji entries inside 600 characters.
  • Over the bound: the counter (and the Save button) shows the over-limit state before the click, and Save is disabled.
  • Empty (or whitespace-only) text: Save is disabled.
  • Neither state calls the endpoint or writes anything; the existing refusal text still renders if a race reaches the host.
  • One sentence in the client docs (docs/subsystems/…) naming the counter and the empty-text rule.

Red first (must be red on 575accc6)

One panel test, no host write needed:

  • empty field → the Save button is disabled (today: enabled);
  • 601 code points (emoji, not ASCII filler) → a counter reads 601/600 and Save is disabled (today: neither exists);
  • 600 code points → counter reads 600/600, Save enabled;
  • the panel renders both states without an endpoint call.

Scope

core/src/client/project-board.js, core/test/project-board-panels.test.js, the client doc, the patches/ds-bot/files/… mirror, one changelog.d fragment with this issue's link.

Not in scope: any change to the bound or its message (that is #1886), grapheme clusters, the metrics panel.

Ordering

core/test/project-board-panels.test.js is also touched by #1886 (the memory-bound case). This branch must rebase on the #1886 PR tip before pushing, keeping both hunks — no parallel edits to the same file without that rebase.

Dedup

Closed-issue search for maxLength / counter / memory box found no issue for advance notice; #1881 fixed the false "Memory saved." after a refusal, not the warning before it.

Verification

Touched suites green at the tip, patches check three lines ok, mirror byte-identical (cmp), base 575accc6.

Activity

  1. added a commit that references this issue on Oct 31, 2026
    d92fe89
  2. HugoXK commented on Oct 31, 2026

    @HugoXK
    ContributorAuthor

    Release

    Written-by: FlyBot Lead
    Released: ec566cc5f28a4f5f94653f4649e80818
    Reason: merged as d92fe89 via PR #1889
    At: 2026-10-31T04:59:22Z

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions