fix(ui): show agent edit control and prevent chat horizontal overflow#2002
fix(ui): show agent edit control and prevent chat horizontal overflow#2002amit-chaubey wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR improves the Agent Details sidebar header/layout to better handle long agent refs and model strings, while also adjusting chat layout containers to prevent horizontal overflow issues. It also adds a dedicated unit test and updates the Jest environment to support responsive hooks in jsdom.
Changes:
- Refactored
AgentDetailsSidebarheader to include an always-visible edit control and split agent ref/model into separate truncated lines. - Updated chat layout container classes to use
min-w-0/flex wrappers for better overflow behavior. - Added jsdom
matchMediamock and a new sidebar test validating edit link + long-text rendering.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| ui/src/components/sidebars/tests/AgentDetailsSidebar.test.tsx | Adds coverage for edit link accessibility/name and long agent ref/model rendering behavior. |
| ui/src/components/sidebars/AgentDetailsSidebar.tsx | Refactors sidebar header + truncation behavior; moves edit control to header and separates agent ref/model lines. |
| ui/src/components/chat/ChatLayoutUI.tsx | Adjusts main layout wrapper to flex/min-width constraints to reduce horizontal overflow. |
| ui/src/components/chat/ChatInterface.tsx | Replaces min-w-full with min-w-0 on root container to prevent unwanted horizontal scrolling. |
| ui/jest.setup.ts | Adds window.matchMedia mock required by sidebar responsive behavior under jsdom. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const agentRef = `${selectedTeam?.agent.metadata.namespace}/${selectedTeam?.agent.metadata.name}`; | ||
| const editHref = `/agents/new?edit=true&name=${selectedAgentName}&namespace=${currentAgent.agent.metadata.namespace}`; |
| Object.defineProperty(window, "matchMedia", { | ||
| writable: true, | ||
| value: jest.fn().mockImplementation((query: string) => ({ | ||
| matches: false, | ||
| media: query, | ||
| onchange: null, | ||
| addListener: jest.fn(), | ||
| removeListener: jest.fn(), | ||
| addEventListener: jest.fn(), | ||
| removeEventListener: jest.fn(), | ||
| dispatchEvent: jest.fn(), | ||
| })), | ||
| }); |
|
thanks for your PR -- can you sign the DCO? |
Move the edit action to the Agent Details header so long agent names and model strings no longer clip it, and constrain the chat column with min-w-0. Signed-off-by: AmitChaubey <amit.katyayana@gmail.com>
4595531 to
6f6c46f
Compare
Done — signed off and force-pushed. Also addressed the two Copilot review comments |
Summary
Fixes the agent edit button being clipped in the Agent Details sidebar when agent names or model strings are long. Moves the edit action into the sidebar header and adds
min-w-0on the chat column to prevent horizontal overflow.Test plan
cd ui && npm test -- AgentDetailsSidebar