Skip to content

Feat: UX enhancements - #72

Closed
achyu-dev wants to merge 6 commits into
pesu-dev:devfrom
achyu-dev:uxenha
Closed

achyu-dev wants to merge 6 commits into
pesu-dev:devfrom
achyu-dev:uxenha

Conversation

@achyu-dev

@achyu-dev achyu-dev commented Jun 3, 2026 •

Copy link
Copy Markdown
Contributor

Resolves #70 and also implements >

  • Expands the width of the chat input and chat messages
  • Think Longer is now added to show the steps with the help of a drop down.
  • TODO: Add edit query option
image image image

@achyu-dev
achyu-dev requested a review from a team as a code owner June 3, 2026 14:07

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the chat UI/UX in the frontend, adding “Think longer” step display, widening the chat layout, and introducing a first pass at editing prior user queries in a conversation.

Changes:

  • Add “thinking steps” capture/display via a collapsible dropdown in assistant messages.
  • Add edit-query flow that truncates conversation history from the edited message onward and re-submits.
  • Expand chat input/message container widths and adjust spacing/styling of message/source components.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 11 comments.

Show a summary per file
File Description
frontend/src/pages/Index.tsx Adds edit-state handling, focus behaviors, and “thinking steps” streaming support; refactors assistant finalization.
frontend/src/lib/chat-store.ts Extends Message with thinkingSteps storage.
frontend/src/lib/api.ts Reworks extractSources parsing logic (but introduces a “first vs last Sources:” parsing bug + debug logging).
frontend/src/components/chat/ChatSources.tsx Minor UI layout tweaks for sources list rendering.
frontend/src/components/chat/ChatMessage.tsx Adds edit button UI and thinking dropdown rendering for assistant messages.
frontend/src/components/chat/ChatInput.tsx Adds autofocus behavior and a data-chat-input marker; increases textarea max height.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread frontend/src/lib/api.ts Outdated
Comment thread frontend/src/lib/api.ts Outdated
Comment thread frontend/src/pages/Index.tsx
Comment thread frontend/src/pages/Index.tsx
Comment thread frontend/src/pages/Index.tsx
Comment thread frontend/src/pages/Index.tsx
Comment thread frontend/src/pages/Index.tsx Outdated
Comment thread frontend/src/components/chat/ChatMessage.tsx
Comment thread frontend/src/components/chat/ChatMessage.tsx
Comment thread frontend/src/components/chat/ChatMessage.tsx Outdated
@aditeyabaral

Copy link
Copy Markdown
Member

Thanks for this, @achyu-dev. It needs a rebase before it can be reviewed, because the repository was restructured after it was opened.

The frontend moved. #73 combined the services into a monorepo on 2026-09-07, so the frontend now lives at services/api/frontend/ rather than frontend/. None of this PR's paths exist on dev any more, and the files it edits have each changed three or four times since:

file commits on dev since this PR opened
src/lib/api.ts 4
src/pages/Index.tsx 3
src/components/chat/ChatSources.tsx 3

Those changes add a sources stream event with dates, a streaming fix in api.ts, and the AskPESU branding.

Before you rebase, a few things worth knowing:

  • Think Longer is already on dev (handleThinkLonger in Index.tsx), so check what this PR still adds on top of it.
  • The description says Resolves Add Edit option for Query #70, but it also lists the edit-query option as a TODO. Add Edit option for Query #70 stays open until that part exists. It can go in this PR or a follow-up.
  • CI now typechecks the frontend. Run npm run typecheck and npm test in services/api/frontend/ before pushing. See CONTRIBUTING.md.

Once it's rebased onto dev, we'll review it.

@aditeyabaral

Copy link
Copy Markdown
Member

Thank you for this, and sorry it has sat open since June.

Closing it, but not because the work was wrong — the opposite. Two things have happened since you opened it:

  • The repository moved to a monorepo layout. The frontend now lives at services/api/frontend/, so every path in this diff has moved, and the four files it touches have changed between one and four times since (lib/api.ts four, pages/Index.tsx three). A rebase would be reconstruction rather than a merge.
  • The streaming protocol changed underneath it: the backend now emits sources as a structured event, and reasoning arrives as step events with their own error handling.

So rather than ask you to rebase onto a moving target, the remaining work is written up as #112 against the current tree, with your screenshots referenced for the intended shape. Both parts are still wanted:

  • The reasoning panel. step events are currently written to a status line that each new step overwrites and that is cleared when the answer finishes, so the reasoning is discarded exactly as you described. Since Thinking mode can return an empty answer when reasoning uses the whole token budget #106 raised the thinking budget to 4096 tokens, reasoning now runs to a median of ~1,450 tokens — a lot of text the product generates and then throws away.
  • The wider chat column. Still capped at max-w-2xl, and answers have got longer since.

Editing a submitted query stays tracked separately in #70.

If you would like to pick up #112, it is yours — it is a clean start against the current frontend rather than a rebase of this branch.

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.

Add Edit option for Query

3 participants