Skip to content

Add chat history and New chat controls below the composer#4133

Merged
bcotrim merged 12 commits into
trunkfrom
add-chat-history-below-composer
Jul 14, 2026
Merged

Add chat history and New chat controls below the composer#4133
bcotrim merged 12 commits into
trunkfrom
add-chat-history-below-composer

Conversation

@bcotrim

@bcotrim bcotrim commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Related issues

  • Related to STU-1985 (chat-history-below-composer thread of the split; does not close the issue)
  • Split from Agentic UI: Simplify Sidebar with new Site-Centric Focus #3998 (extract-site-centric-sidebar) — "add" half of the add-before-remove sequencing: this PR adds the session chat controls below the composer while the sidebar keeps its current chat sublists; a follow-up PR makes the sidebar site-centric.

How AI was used in this PR

Claude Code adapted the session-chrome portion of @shaunandrews' extract-site-centric-sidebar branch onto trunk (his authorship is preserved via Co-authored-by), and implemented the ⌘N accelerator fix. All changes reviewed by @bcotrim.

Proposed Changes

We want chat access to live with the conversation rather than in the sidebar, and to discourage multiple concurrent chats per site. This PR adds a footer row below the composer in the agentic UI (apps/ui) for sessions that belong to a site:

  • Chat history menu: opens upward, lists the site's chats newest-first with first-prompt titles and relative timestamps, marks the current chat, and offers a per-row archive action on hover. Empty state shows "No chats yet".
  • Archived chats dialog: reachable from the history menu (entry shows the count); selecting an archived chat reopens it.
  • New chat button: creates a fresh session for the current site and navigates to it; disabled while creating; ⌘N/Ctrl+N shortcut shown in the tooltip.
  • ⌘N conflict fix: the desktop menu bound CommandOrControl+N to "File → Add Site…", which consumed the key before the renderer ever saw it — so the New chat shortcut could never work in the desktop app. When the agentic UI is active, the menu item no longer registers the accelerator (the item itself remains). The classic UI keeps ⌘N for Add Site unchanged.

Testing Instructions

Enable the Agentic UI feature flag and open a chat session that belongs to a site:

  1. A footer row appears bottom-left below the composer with a history button and a "New chat" button; while the session is loading, the layout doesn't jump.
  2. Open the chat history menu: it opens upward, lists only this site's non-archived chats newest-first, titles from the first prompt (truncating cleanly when long), relative timestamps, and the active chat highlighted/marked as current.
  3. Hover a history row: the timestamp swaps to an archive button; archiving removes the chat from the menu and it appears in the "Archived chats" dialog (menu entry shows the count). Reopening an archived chat switches to it.
  4. Click "New chat" (or press ⌘N/Ctrl+N): a fresh session for the site is created and opened; the button is disabled while creating; the tooltip shows the shortcut.
  5. Desktop ⌘N: with the agentic UI active, File → Add Site… shows no ⌘N shortcut and ⌘N starts a new chat. With the flag off (classic UI), ⌘N still opens Add Site. Toggling the flag from the dev Feature Flags menu updates the menu after the renderer reloads.
  6. A site with no other chats shows "No chats yet" in the menu.
  7. Verify in both light and dark mode.

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?

@bcotrim bcotrim self-assigned this Jul 8, 2026
@bcotrim bcotrim marked this pull request as ready for review July 9, 2026 20:59
@bcotrim bcotrim requested review from a team, katinthehatsite and shaunandrews July 9, 2026 21:00
@wpmobilebot

wpmobilebot commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

📊 Performance Test Results

Comparing af3c150 vs trunk

app-size

Metric trunk af3c150 Diff Change
App Size (Mac) 1350.35 MB 1350.36 MB +0.01 MB ⚪ 0.0%

site-editor

Metric trunk af3c150 Diff Change
load 1088 ms 1066 ms 22 ms ⚪ 0.0%

site-startup

Metric trunk af3c150 Diff Change
siteCreation 6487 ms 6990 ms +503 ms 🔴 7.8%
siteStartup 2386 ms 2390 ms +4 ms ⚪ 0.0%

Results are median values from multiple test runs.

Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff)

@katinthehatsite katinthehatsite left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the changes mostly look good. I have two notes regarding this:

  • I did not get what this icon was doing:
Image

I thought it was meant to refresh a chat or restart a chat. I think it looks too similar to the refresh ico. I would either remove the icon and that functionality from the footer completely or change it for something else.

  • I am finding this flash of the new chat row a big weird if you are already on a new chat (so select an Untitled chat and try to add a new chat):
Screen.Recording.2026-07-13.at.3.22.10.PM.mov

I think this could benefit from a smoother transition.

@katinthehatsite

Copy link
Copy Markdown
Contributor

One more comment is that if you tab through the New chat option in the sidebar, the top and bottom borders are cut off on focus:

Screenshot 2026-07-13 at 3 26 21 PM

@bcotrim

bcotrim commented Jul 13, 2026

Copy link
Copy Markdown
Contributor Author
  • I did not get what this icon was doing:
Image I thought it was meant to refresh a chat or restart a chat. I think it looks too similar to the refresh ico. I would either remove the icon and that functionality from the footer completely or change it for something else.

It matches the design from @shaunandrews and the icon in WordPress.com so I would say to keep it for now and we can align on it later when Shaun is back from AFK.

image

@bcotrim bcotrim requested a review from katinthehatsite July 13, 2026 16:24
@bcotrim

bcotrim commented Jul 13, 2026

Copy link
Copy Markdown
Contributor Author

@katinthehatsite I fixed all the issues, can you take another look please? 🙇

@katinthehatsite

Copy link
Copy Markdown
Contributor

It matches the design from @shaunandrews and the icon in WordPress.com so I would say to keep it for now and we can align on it later when Shaun is back from AFK.

Sounds good 👍

@katinthehatsite katinthehatsite left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this looks good now 👍 The issues mentioned before are resolved for me:

Image

bcotrim added 3 commits July 14, 2026 09:53
…ow-composer

# Conflicts:
#	apps/ui/src/ui-classic/components/session-view/index.tsx
…ow-composer

# Conflicts:
#	apps/ui/src/components/site-list/index.tsx
@bcotrim bcotrim enabled auto-merge (squash) July 14, 2026 09:52
@bcotrim bcotrim merged commit be37665 into trunk Jul 14, 2026
11 checks passed
@bcotrim bcotrim deleted the add-chat-history-below-composer branch July 14, 2026 10:00
bcotrim added a commit that referenced this pull request Jul 16, 2026
## Related issues

- Related to STU-1985
- Final extraction from #3998 (built on the already-landed #4131, #4133,
and #4134)

## How AI was used in this PR

Claude (Fable 5) extracted and adapted this change from the #3998
reference branch under close direction, preserving Shaun Andrews'
original work via co-authored commits, and re-verified the result
(typecheck, unit tests, light/dark visual pass in the browser UI). Code
was human-reviewed throughout.

## Proposed Changes

This is the capstone of the site-centric sidebar work: the sidebar
becomes a flat list of sites, with no per-site chat sublists.

- Clicking a site opens its most recent (non-archived) chat, or starts a
new chat when the site has none. Chat history is no longer browsed from
the sidebar — that moved below the composer in #4133.
- Each site row carries a single activity indicator that aggregates all
of the site's sessions, with priority: live-site sync > needs an answer
> working > new message. This keeps long site lists calm while still
surfacing what needs attention.
- Row quick actions (site actions menu + start/stop status button)
appear on hover/focus; drag-to-reorder from #4134 keeps working on the
flat rows.
- Status colors move to shared `--studio-color-status-*` tokens: the
wpds palette has no vivid status colors
(`--wpds-color-fg-content-success` resolves to near-black at dot size),
which also fixes the session header's running dot rendering almost
black.
- Chrome polish: full-bleed 44px site icon with overlaid status badge in
the site dropdown, flattened site icons, a visible hover tint on the
sidebar create button, the floating sidebar toggle moved to the
bottom-left, and aligned settings-header padding.

Two product decisions to be aware of (intentional for now):

- **Unread "new message" badges are in-memory only** — they reset (seed
as all-seen) on every launch.
- **The current chat is indicated via `aria-current` + active-row
styling**, not the literal "Current chat" label from the mockups.

## Testing Instructions

- Start Studio with `npm start` and enable the `Agentic UI` feature
flag.
- Confirm the sidebar shows a flat list of sites (no chat sublists):
clicking a site with chats opens its latest chat; a site without chats
opens the new-chat view.
- Hover a row: the site actions menu and start/stop button appear; right
side shows a green dot for running sites, a play affordance for stopped
ones.
- Send a prompt on one site, switch to another: the first row shows a
working spinner, then a "New message" badge when the turn completes;
answering a pending question clears the "Needs an answer" indicator.
- Drag a site row to reorder; the order persists across restarts.
- Delete a site you're currently viewing and confirm you land back on
the home view.
- Check the sidebar and site dropdown in **both light and dark mode**.

## Pre-merge Checklist

- [x] Have you checked for TypeScript, React or other console errors?

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Shaun Andrews <191598+shaunandrews@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants