# Admin message origin

Nhận diện người viết bằng nhãn và giữ tin phía shop trên một nền trung tính.

## Key rules

- Admin: nhận diện nguồn tin bằng `InboxSenderLabel`, gồm tên người gửi và nhãn AI hoặc Auto từ metadata.
- Admin: mọi tin phía shop dùng cùng nền `--chatty-color-bg-surface-secondary`; không đổi màu nền theo nguồn.
- Admin: không suy đoán nguồn từ nội dung, attachment hay độ dài; chỉ đọc `senderType` và `senderMeta.badge`.

## Use when / Avoid

Dùng khi nhân viên đọc xen kẽ tin AI, phản hồi tự động và đồng nghiệp. Ghi chú nội bộ, tin lỗi và xác nhận hệ thống có kiểu riêng, không thuộc pattern này.

### Use instead

| Component | Use when |
| --- | --- |
| `InboxSenderLabel` | Hiện tên và nhãn nguồn phía trên nhóm tin. |
| `chatty-message__bubble` | Nền trung tính chung cho tin self của shop. |

## Entry points

| Surface | Owner |
| --- | --- |
| Admin | InboxV2ChatArea truyền `renderSenderLabel` cho khung tin. |

## Flow

| Surface | Step | Trigger | UI shown | Component | Copy + i18n key | Timing |
| --- | --- | --- | --- | --- | --- | --- |
| Admin | Gắn nhãn | `senderMeta.badge` là auto, hoặc `senderType` là bot | Tên cùng nhãn Auto hoặc AI | `InboxSenderLabel` | AI, Auto; không có i18n key | Render đồng bộ cùng tin |
| Admin | Tô nền | Tin self không phải note hoặc failed | Nền trung tính chung | `chatty-message__bubble` | Không có chuỗi | CSS, không có chuyển động |

## Edge cases

| Surface | Case | Behaviour |
| --- | --- | --- |
| Admin | Không có tên người gửi | Không render nhãn dù có badge. |
| Admin | Tin trong nhóm gộp | Ẩn sender ở mọi hàng nối tiếp cùng người gửi trong ngày qua `&--grouped-prev` và `&--run-prev`. |
| Admin | Tin failed | Không nhận nền trung tính; trạng thái dùng `--chatty-color-critical`. |

## Live preview

Example (Standard) — Standard: complete widget, fixture conversation and surface dimensions.

```js
import '@avada/chatty-ui/tokens/admin.css';
import {html} from 'lit';
import {IconClose, IconMessage} from '@avada/chatty-ui/elements/icon-glyphs.js';
import '@avada/chatty-ui/elements/surface.js';
import '@avada/chatty-ui/elements/avatar.js';
import '@avada/chatty-ui/elements/badge.js';
import '@avada/chatty-ui/elements/icon-button.js';
import '@avada/chatty-ui/elements/launcher.js';
import '@avada/chatty-ui/elements/button.js';
import {sameGroup} from '@avada/chatty-ui/behaviors/messages.js';

// Reference viewport: 1280 × 900 desktop, 390 × 900 mobile.
const sizes = {
  classic: {width: 400, height: 700},
  'ai-mode': {width: 820, height: 657},
  admin: {width: 527, height: 842}
};
const question = {
  id: 'question',
  senderType: 'customer',
  text: 'Can you help me?',
  createdAt: '2026-01-15T10:00:00Z'
};

/** Viewport-relative sizing survives the initial hidden iframe layout. */
function widgetSize(surface) {
  const mode = new URLSearchParams(location.search).get('mobile');
  const isMobile = mode === null ? innerWidth < 900 : mode === 'true';
  const width = `min(${sizes[surface].width}px, max(0px, 100vw - 40px))`;
  const height = isMobile
    ? `min(${surface === 'admin' ? 848 : 888}px, round(down, calc(${width} * 2.2), 1px))`
    : `${sizes[surface].height}px`;
  return {...sizes[surface], height, mobile: isMobile};
}

/** Local immutable message state with real subscriptions for live previews. */
function fixtureStore(initial) {
  let state = {messages: initial};
  const listeners = new Set();
  return {
    getState: () => state,
    subscribe(listener) {
      listeners.add(listener);
      return () => listeners.delete(listener);
    },
    setMessages(messages) {
      state = {messages};
      listeners.forEach(listener => listener());
    }
  };
}

/** Appends the viewer message without replacing the existing conversation. */
function appendViewer(store, surface, text) {
  const message = {
    id: `viewer-${store.getState().messages.length}`,
    senderType: surface === 'admin' ? 'agent' : 'customer',
    senderMeta: {name: surface === 'admin' ? 'Alex' : 'You'},
    text,
    createdAt: new Date().toISOString()
  };
  store.setMessages([...store.getState().messages, message]);
}

/**
 * One shell owns surface sizing, header, thread and composer for every pattern.
 * @param {string} surface
 * @param {Object} store
 * @param {Object} strings
 * @param {Object} content
 * @param {Function} renderMessage
 * @param {Function} onSend
 * @param {Object} registry
 * @param {boolean} composerHidden
 * @param {string} title
 * @param {Object} headerStart
 * @param {Object} headerActions
 * @param {boolean} sheet
 * @param {string | null} status
 * @returns {Object}
 */
function patternShell({
  surface,
  store,
  strings = {header: 'Store assistant', message: 'Message', send: 'Send'},
  content,
  renderMessage,
  onSend,
  registry,
  title,
  headerStart,
  headerActions,
  status = 'online',
  sheet = false,
  composerHidden = false
}) {
  const size = widgetSize(surface);
  const mobileSheet = sheet && size.mobile;
  if (mobileSheet) {
    size.width = 'none';
    size.height = 'calc(100dvh - 12px)';
  }
  const toggle = (event, closed) => {
    const frame = event.currentTarget.closest('[data-pattern-frame]');
    const panel = frame.querySelector('chatty-surface');
    const launcher = frame.querySelector('[data-pattern-launcher]');
    panel.hidden = closed;
    frame.dataset.closed = String(closed);
    const background = frame.querySelector('[data-sheet-page]');
    if (background) background.inert = !closed && surface === 'ai-mode';
    launcher.hidden = !closed;
    if (closed) {
      launcher.style.insetBlockEnd = `${Math.max(surface === 'ai-mode' ? 40 : 16, frame.getBoundingClientRect().bottom - innerHeight + 20)}px`;
      launcher.focus({preventScroll: true});
    } else {
      const composer = panel.querySelector('chatty-composer');
      const input = !composer.hidden
        ? composer.renderRoot.querySelector('textarea')
        : (panel
            .querySelector('chatty-contact-form:not([hidden])')
            ?.renderRoot.querySelector('chatty-text-field') ??
          panel.querySelector('form chatty-text-field') ??
          panel.querySelector('[data-welcome-invitation]:not([hidden]) chatty-button') ??
          panel
            .querySelector('chatty-pre-chat:not([hidden])')
            ?.renderRoot.querySelector('chatty-button'));
      input?.focus({preventScroll: true});
    }
  };
  const sender = message => {
    const content = renderMessage?.(message) ?? {};
    const messages = store.getState().messages;
    const previous = messages[messages.indexOf(message) - 1];
    if (message.senderType !== 'bot' || sameGroup(message, previous)) return content;
    return {
      ...content,
      sender: html`<span style="display:inline-flex;align-items:center;gap:6px"
        ><chatty-avatar size="sm" label="Assistant">A</chatty-avatar
        >${content.sender ?? message.senderName ?? message.senderMeta?.name ?? 'Assistant'}</span
      >`
    };
  };
  return html`<style>
      [data-pattern-frame] {
        display: flex;
        position: relative;
        justify-content: center;
        inline-size: 100%;
        min-inline-size: 0;
      }
      [data-pattern-frame='classic'] {
        justify-content: flex-end;
      }
      [data-pattern-frame] chatty-surface::part(header) {
        padding: 0;
      }
      [data-pattern-frame='classic'] chatty-surface::part(header),
      [data-pattern-frame='ai-mode'] chatty-surface::part(header) {
        border-bottom-width: 0;
      }
      [data-pattern-frame] [hidden] {
        display: none !important;
      }
      [data-pattern-header] {
        display: flex;
        align-items: center;
        gap: 10px;
        box-sizing: border-box;
        min-inline-size: 0;
        block-size: 52px;
        padding: 0 16px;
      }
      [data-pattern-frame='classic'] [data-pattern-header] {
        block-size: 56px;
        background: var(--chatty-color-accent);
        color: var(--chatty-color-on-accent);
      }
      [data-pattern-frame='classic'] [data-pattern-header] chatty-icon-button {
        --chatty-color-border-focus: var(--chatty-color-on-accent);
      }
      [data-pattern-frame='admin'] [data-pattern-header] {
        block-size: 68px;
        padding: 8px 12px;
      }
      [data-pattern-header] chatty-avatar {
        --chatty-avatar-size: 32px;
      }
      [data-pattern-frame='classic'] [data-pattern-header] chatty-avatar {
        --chatty-avatar-background: #fff;
      }
      [data-pattern-frame='classic'] [data-pattern-header] chatty-avatar::part(base) {
        color: #303030;
        border: 1px solid #767676;
      }
      [data-pattern-actions] {
        display: flex;
        align-items: center;
        gap: 8px;
      }
      [data-pattern-title] {
        flex: 1;
        min-inline-size: 0;
        display: flex;
        flex-direction: column;
      }
      [data-pattern-frame='admin'] [data-pattern-title] {
        gap: 4px;
      }
      [data-pattern-frame='admin'] [data-pattern-title] strong {
        display: flex;
        align-items: center;
        min-block-size: 28px;
        font: var(--p-font-weight-semibold, 650) var(--p-text-heading-md-font-size, 14px) /
          var(--p-text-heading-md-font-line-height, 20px) var(--p-font-family-sans, system-ui);
      }
      [data-pattern-title] strong {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }
      [data-pattern-header] chatty-icon-button {
        --chatty-icon-button-size: 32px;
        --chatty-icon-button-color: currentColor;
      }
      @media (max-width: 899px), (pointer: coarse) {
        [data-pattern-header] chatty-icon-button {
          --chatty-icon-button-size: 44px;
        }
      }
      [data-pattern-launcher] {
        position: absolute;
        inset-inline-end: 0;
        inset-block-end: 0;
      }
      [data-pattern-frame='ai-mode'] [data-pattern-launcher] {
        inset-inline-end: auto;
        inset-inline-start: 50%;
        transform: translateX(-50%);
      }
      [data-pattern-frame='classic'] [data-pattern-launcher] {
        --chatty-icon-button-size: 56px;
        border-radius: 50%;
        background: var(--chatty-color-accent);
        --chatty-icon-button-color: var(--chatty-color-on-accent);
      }
      [data-sheet-mobile='true'] {
        position: fixed;
        inset: 0;
        inline-size: 100vw;
      }
      [data-sheet-mobile='true'] chatty-surface::part(base) {
        border-radius: 16px 16px 0 0;
      }
      [data-sheet-mobile='true'] chatty-surface {
        position: relative;
        z-index: 2;
        margin-block-start: 12px;
      }
      [data-sheet-page],
      [data-sheet-scrim] {
        position: absolute;
        inset: 0;
        box-sizing: border-box;
      }
      [data-sheet-page] {
        padding: 20px;
        background: var(--chatty-color-bg-surface);
        color: var(--chatty-color-text);
      }
      [data-sheet-scrim] {
        z-index: 1;
        border: 0;
        background: rgb(0 0 0 / 40%);
        animation: sheet-scrim 400ms ease;
      }
      [data-sheet-mobile='true'][data-closed='true'] [data-sheet-scrim] {
        display: none;
      }
      [data-sheet-mobile='true'] [data-pattern-launcher] {
        z-index: 3;
      }
      @keyframes sheet-scrim {
        from {
          opacity: 0;
        }
        to {
          opacity: 1;
        }
      }
      @media (prefers-reduced-motion: reduce) {
        [data-sheet-scrim] {
          animation: none;
        }
      }
    </style>
    <div
      data-pattern-frame=${surface}
      data-sheet-mobile=${String(mobileSheet)}
      data-closed="false"
      style=${`block-size:calc(${size.height} + ${mobileSheet ? 12 : 0}px)`}
    >
      ${
        mobileSheet
          ? html`<div data-sheet-page .inert=${surface === 'ai-mode'}>
                <p>Example storefront</p>
                <chatty-button
                  variant="secondary"
                  type="button"
                  @click=${event => {
                    event.currentTarget.textContent = 'Products opened';
                  }}
                >
                  Browse products
                </chatty-button>
              </div>
              ${surface === 'ai-mode' ? html`<button type="button" data-sheet-scrim tabindex="-1" aria-label="Close chat background" @click=${event => toggle(event, true)}></button>` : ''}`
          : ''
      }
      <chatty-surface
        data-chatty-surface=${surface}
        data-chatty-theme=${surface === 'admin' ? 'light' : (document.documentElement.dataset.chattyTheme ?? document.documentElement.dataset.theme ?? 'light')}
        style=${`inline-size:100%;max-inline-size:${mobileSheet ? 'none' : `${size.width}px`};--chatty-surface-height:${size.height}`}
        .store=${store}
        .registry=${registry ?? null}
        viewer-type=${surface === 'admin' ? 'agent' : 'customer'}
        .selfTypes=${surface === 'admin' ? ['agent', 'bot'] : null}
        .renderMessage=${sender}
      >
        <div slot="header" data-pattern-header>
          ${headerStart ?? ''}
          ${surface === 'admin' ? '' : html`<chatty-avatar label="Store" .status=${status}>S</chatty-avatar>`}
          <span data-pattern-title
            ><strong
              >${title ?? (surface === 'admin' ? 'Customer conversation' : strings.header)}</strong
            >${surface === 'admin' ? html`<chatty-badge size="sm" variant="secondary" style="align-self:flex-start">Customer</chatty-badge>` : status == null ? '' : html`<small data-pattern-status>${status === 'online' ? 'Open' : 'Closed'}</small>`}</span
          >
          <span data-pattern-actions>${headerActions ?? ''}</span>
          ${
            surface === 'admin'
              ? ''
              : html`<chatty-icon-button label="Close panel" @click=${event => toggle(event, true)}
                  >${IconClose()}</chatty-icon-button
                >`
          }
        </div>
        <chatty-thread .strings=${{bot: 'Assistant', ...strings}}></chatty-thread>${content ?? ''}
        <chatty-composer
          slot="footer"
          ?hidden=${composerHidden}
          .label=${strings.message}
          .sendLabel=${strings.send}
          @chatty-send=${event => {
            appendViewer(store, surface, event.detail.text);
            if (onSend) onSend(event.detail.text, event.currentTarget);
            else if (surface !== 'admin')
              store.setMessages([
                ...store.getState().messages,
                {
                  id: `fixture-${store.getState().messages.length}`,
                  senderType: 'bot',
                  text: `You asked: “${event.detail.text}”. I can help with that.`,
                  hasEventTime: false
                }
              ]);
          }}
        ></chatty-composer> </chatty-surface
      >${
        surface === 'admin'
          ? ''
          : surface === 'ai-mode'
            ? html`<chatty-launcher
                data-pattern-launcher
                hidden
                label="Open chat"
                @chatty-open=${event => toggle(event, false)}
                >${IconMessage({size: 20, slot: 'icon'})}Ask a question</chatty-launcher
              >`
            : html`<chatty-icon-button
                data-pattern-launcher
                hidden
                size="lg"
                label="Open chat"
                @click=${event => toggle(event, false)}
                >${IconMessage({size: 24})}</chatty-icon-button
              >`
      }
    </div>`;
}

const strings = {
  header: 'Store assistant',
  message: 'Message',
  send: 'Send',
  ai: 'AI',
  auto: 'Auto',
  you: 'You'
};
export function Standard() {
  const store = fixtureStore([
    {...question, text: 'Where is my order?'},
    {
      id: 'ai',
      senderType: 'bot',
      senderMeta: {name: 'Shop assistant'},
      text: 'I can help you track it.',
      createdAt: '2026-01-15T10:01:00Z'
    },
    {
      id: 'auto',
      senderType: 'bot',
      senderMeta: {name: 'Saved reply', badge: 'auto'},
      text: 'Our team will be with you shortly.',
      createdAt: '2026-01-15T10:02:00Z'
    },
    {
      id: 'human',
      senderType: 'agent',
      senderMeta: {name: 'Alex'},
      text: 'I will check that for you.',
      createdAt: '2026-01-15T10:10:00Z'
    }
  ]);
  const renderMessage = message => {
    const badge =
      message.senderMeta?.badge === 'auto'
        ? strings.auto
        : message.senderType === 'bot'
          ? strings.ai
          : '';
    return {
      badge: badge
        ? html`<span
            style="background:rgba(0,0,0,.06);color:#616161;border-radius:4px;padding:0 5px;font-size:10px"
            >${badge}</span
          >`
        : undefined
    };
  };
  return patternShell({surface: 'admin', store, strings, renderMessage});
}
```

Current: các story React bên dưới giữ nguyên.

Example (Current (React), being replaced) — InboxSenderLabel thật cho AI, Auto và nhân viên; chỉ là fragment nhãn, không phải cả bubble.

```jsx
import React from 'react';
import {InboxSenderLabel} from '@assets/pages/InboxManagement/v2/slots/InboxSenderLabel.jsx';

export function Labels() {
  return (
    <div>
      <InboxSenderLabel vm={{senderType: 'bot', senderMeta: {name: 'Shop assistant'}}} />
      <InboxSenderLabel vm={{senderType: 'agent', senderMeta: {name: 'Saved reply', badge: 'auto'}}} />
      <InboxSenderLabel vm={{senderType: 'agent', senderMeta: {name: 'Alex'}}} />
    </div>
  );
}
```

## Admin

### Import / element

#### InboxSenderLabel

| Component / element | Import / file | Scope root |
| --- | --- | --- |
| `InboxSenderLabel` | @assets/pages/InboxManagement/v2/slots/InboxSenderLabel.jsx | .inbox-v2 |

#### chatty-message\_\_bubble

| Component / element | Import / file | Scope root |
| --- | --- | --- |
| `chatty-message__bubble` |  | .inbox-v2 |

### Anatomy

#### InboxSenderLabel

| Part | Element |
| --- | --- |
| 1 | Phần tử `div` có class `chatty-message__sender` chứa tên người gửi. |
| 2 | Phần tử `span` có class `chatty-message__sender-badge` chứa nhãn AI hoặc Auto khi có. |

#### chatty-message\_\_bubble

| Part | Element |
| --- | --- |
| 1 | Bubble `chatty-message__bubble` của tin `chatty-message--self`, trừ note và failed. |
| 2 | Link `a` trong bubble giữ màu link và gạch chân. |
| 3 | Đoạn `code` trong bubble có nền riêng. |

### Placement / order

#### InboxSenderLabel

| Context | Order |
| --- | --- |
| Nhóm người gửi | Nhãn đứng phía trên bubble đầu tiên của nhóm. |
| Trong nhãn | Tên trước, nhãn nguồn sau trong cùng một dòng. |

#### chatty-message\_\_bubble

| Context | Order |
| --- | --- |
| Mọi nguồn | AI, Auto và nhân viên dùng chung một nền; khác biệt nằm ở nhãn nguồn. |

### Props

#### InboxSenderLabel

| Prop | Type | Values | Default | Notes |
| --- | --- | --- | --- | --- |
| `vm` | App.CanonicalChatMessage | senderType, senderMeta.name, senderMeta.badge | Bắt buộc | Không có prop nào khác; thiếu tên thì không render. |

#### chatty-message\_\_bubble

| Prop | Type | Values | Default | Notes |
| --- | --- | --- | --- | --- |
| `chatty-message--self` | CSS class | Áp nền trung tính, trừ `chatty-message--note` và `chatty-message--failed` | Caller | Chọn bằng selector, không có prop React. |

### Sizes

#### InboxSenderLabel

| Size | Height | Padding | Gap | Radius | Font role (px/rem) | Hit target | Breakpoint / mechanism |
| --- | --- | --- | --- | --- | --- | --- | --- |
| Tên | Theo nội dung | 0 12px | Không khai báo | Không khai báo | heading-small: Derived(12px = type(heading-small, admin, desktop, size)) / Derived(18px = type(heading-small, admin, desktop, line)) desktop → Derived(13px = type(heading-small, admin, mobile, size)) / Derived(20px = type(heading-small, admin, mobile, line)) mobile; weight 500 | Không tương tác | Admin mobile khi `(max-width: 47.9975em)` |
| Nhãn nguồn | Theo nội dung | 0 4px | margin-left 4px | 3px | heading-small: Derived(12px = type(heading-small, admin, desktop, size)) / Derived(18px = type(heading-small, admin, desktop, line)) desktop → Derived(13px = type(heading-small, admin, mobile, size)) / Derived(20px = type(heading-small, admin, mobile, line)) mobile; weight 500 | Không tương tác | Cùng breakpoint với tên |

#### chatty-message\_\_bubble

| Size | Height | Padding | Gap | Radius | Font role (px/rem) | Hit target | Breakpoint / mechanism |
| --- | --- | --- | --- | --- | --- | --- | --- |
| Bubble | Theo nội dung | 8px 12px | Không khai báo | `$radius-bubble` | body-medium: Derived(13px = type(body-medium, admin, desktop, size)) / Derived(20px = type(body-medium, admin, desktop, line)) desktop → Derived(15px = type(body-medium, admin, mobile, size)) / Derived(22px = type(body-medium, admin, mobile, line)) mobile | Native box | Cột chi tiết dùng max-width theo layout; bubble theo container |

### Tokens

#### InboxSenderLabel

| Part | Token | Light | Dark |
| --- | --- | --- | --- |
| Chữ tên | `--chatty-color-text-secondary` | #616161 | No Dark skin |
| Nền nhãn | Không có token | rgba(0, 0, 0, 0.06) | No Dark skin |
| Chữ nhãn | `--chatty-color-text-secondary` | #616161 | No Dark skin |

#### chatty-message\_\_bubble

| Part | Token | Light | Dark |
| --- | --- | --- | --- |
| Nền | `--chatty-color-bg-surface-secondary` | #f7f7f7 | No Dark skin |
| Chữ | `--chatty-color-text` | #303030 | No Dark skin |
| Viền | `--chatty-color-border` | #d4d4d4 | No Dark skin |
| Link | `--chatty-color-text-link` | #005bd3 | No Dark skin |

### States

#### InboxSenderLabel

| State | Trigger | Visual change (values) | ARIA/attribute |
| --- | --- | --- | --- |
| Chỉ tên | Không phải bot và badge khác auto | Chỉ hiện tên, không có nhãn. | Không có ARIA riêng |
| AI | `senderType` là bot | Hiện nhãn AI cạnh tên. | Không có ARIA riêng |
| Auto | `senderMeta.badge` là auto | Hiện nhãn Auto; thắng nhãn AI vì được kiểm tra trước. | Không có ARIA riêng |
| Ẩn | Không có tên | Component trả về null. | Không có ARIA riêng |

#### chatty-message\_\_bubble

| State | Trigger | Visual change (values) | ARIA/attribute |
| --- | --- | --- | --- |
| Mặc định | `chatty-message--self` không phải note hoặc failed | Nền #f7f7f7, viền 1px solid #d4d4d4 | Không có ARIA riêng |
| Link | Có `a` trong bubble | Gạch chân (`text-decoration: underline`) | Không có ARIA riêng |
| Failed | `chatty-message--failed` | Không nhận nền trung tính; chữ trạng thái `--chatty-color-critical` #c5280c | Không có ARIA riêng |

### Behaviour

#### InboxSenderLabel

| Interaction | Result |
| --- | --- |
| Tương tác | Không có handler; nhãn chỉ hiển thị. |
| Nhóm liên tiếp | Slot luôn render; CSS quyết định ẩn hiện khi nhóm gộp. |

#### chatty-message\_\_bubble

| Interaction | Result |
| --- | --- |
| Đổi nguồn | Nền không đổi theo AI, Auto hay nhân viên. |
| Layout card, centered, compact | Nhãn sender bị ẩn vì bubble của block giữ hàng. |

### Copy

#### InboxSenderLabel

| String | i18n key | Where |
| --- | --- | --- |
| AI | Không có i18n key | Nhãn khi `senderType` là bot |
| Auto | Không có i18n key | Nhãn khi `senderMeta.badge` là auto |

#### chatty-message\_\_bubble

| String | i18n key | Where |
| --- | --- | --- |
| Not available | Not available | Bubble không sở hữu chuỗi cố định |

### Source

#### InboxSenderLabel

| File | Evidence |
| --- | --- |
|  | Slot render và quy tắc nguồn |
|  | Ẩn sender ở hàng nối tiếp cùng run |
|  | Kiểu tên và nhãn |

#### chatty-message\_\_bubble

| File | Evidence |
| --- | --- |
|  | Nền trung tính cho mọi tin self |
|  | Layout ẩn sender |

## Do / Don't

Do: đọc nguồn tin từ tên người gửi và nhãn AI hoặc Auto.

Don't: dùng nền màu thay cho nhãn, hoặc coi mọi tin có attachment là tự động.

## Accessibility

| Surface | Role / name | Keyboard / focus | Live region | Contrast pair / ratio |
| --- | --- | --- | --- | --- |
| Admin | Nhãn là text trong `div`, không có role riêng. | Không focus được; text tĩnh. | Không có live region. | Measured(#616161 / #f1f2fe = 5.57:1) |
| Admin | Nội dung bubble là text thường. | Không áp dụng: pattern không có submit, lỗi hay Retry. | Không có live region. | Measured(#303030 / #f7f7f7 = 12.32:1) |

