LibreChat/client/src/components/Messages
aruj0 d6f8b2e92a
🏷️ fix: Keep a Configured Sender Label From Revealing the Model on Hover (#15489)
A conversation whose sender is a label someone configured shows that label as the
header's name. Since #14851 the header's hover crossfade swaps the raw `message.model`
back in, and the sr-only "Model:" text announces it regardless of hover.

Ask the message, not the settings. `resolveSender` writes an agent's name, then the
`getEphemeralSender` chain — a preset's `modelLabel`, a model spec's `label`, an
endpoint's `modelDisplayLabel` — and falls back to `getResponseSender` only when none
is set, so the persisted `sender` is the one thing that records which it was. The new
`isConfiguredSender` compares it against what `getResponseSender` would produce for the
same endpoint and model: equal means the header is showing a model-derived name and the
hover may reveal the model, different means it is standing in for one.

That settles three things a settings lookup cannot. Labels that live in config a caller
may not hold — a spec that sets `label` and leaves `preset.modelLabel` unset is the
ordinary shape, and the share publisher cannot read the spec list. Labels an endpoint
ignores — Anthropic keeps writing `Claude` whatever `chatGptLabel` says, and it matches
here without anything enumerating which endpoints honour what. And labels changed since
the message was written — the row still shows the sender it was written under, so
clearing a label must not start revealing the model behind the rows that carry it.

Equality is the test, so the ordinary way to be wrong is a stored name that no longer
matches what the current heuristics produce, which withholds a model rather than
revealing one. Three cases are decided before any comparison: a user turn is headed by
its author and has no model to withhold; agents and assistants are named by whoever
authored them, so the header shows that name whether or not the response stored a
sender; and an endpoint that cannot be named — an older message saved without one —
says nothing either way, where reading silence as a label would withhold the model from
every unlabelled row it reached.

`getHeaderHoverLabel` takes that answer and produces no hover label when it is true, so
the header renders the plain label with no swap and no sr-only model text. Without a
configured sender the behaviour is unchanged.

- Chat rows: `useMessageActions` and `useMessageHelpers` decide once per row from the
  message they already hold, so MessageRender, MessageParts and ContentRender consume it
  like any other derived display state.
- Share links: the view has no conversation in scope, so `getSharedMessages` reads the
  answer off the very messages it is returning, collected in the pass `anonymizeMessages`
  already makes rather than a second traversal. Only messages the link actually publishes
  have a say, and nothing about the link is re-derived from the conversation afterwards.
  `ShareContext` — already the carrier for share-scoped values such as `shareId` — hands
  it to the header.

The flag travels rather than the label text: each surface only needs the decision, and
the text is already carried by `message.sender`, which the share content preflight
inspects.

Search rows are left alone. `GET /api/messages?search` returns each hit's stored sender
and endpoint but overwrites `model` with the conversation's current one, so a row cannot
be classified from what it carries without changing what that payload means.
2026-09-13 11:57:12 -04:00
..
__tests__ 🫣 fix: Hide Scroll-to-Bottom Under Composer Panels (#15746) 2026-09-08 13:33:44 -04:00
Content 🖋️ feat: Seal Code Environment Choices Per Conversation (#15868) 2026-09-12 20:45:00 -04:00
ContentRender.tsx 🏷️ fix: Keep a Configured Sender Label From Revealing the Model on Hover (#15489) 2026-09-13 11:57:12 -04:00
MessageContent.tsx 📐 feat: Match the Message Column to the Composer (#14851) 2026-08-15 07:19:34 +02:00
ScrollToBottom.tsx 🫣 fix: Hide Scroll-to-Bottom Under Composer Panels (#15746) 2026-09-08 13:33:44 -04:00