Skip to content
This repository was archived by the owner on Jul 27, 2026. It is now read-only.

fix(frontend): remove inner edge gaps in empty and diff states - #213

Merged
hieptl merged 1 commit into
mainfrom
hieptl/app-1646
May 9, 2026
Merged

hieptl merged 1 commit into
mainfrom
hieptl/app-1646

Conversation

@hieptl

@hieptl hieptl commented May 9, 2026

Copy link
Copy Markdown
Contributor

Resolves #2320

Description

When a user opens a new conversation in agent-server-gui and looks at the Changes tab in the right-side conversation panel, the panel content does not fill the bordered container — there are visible dark gaps along the inner edges:

  • Empty state ("OpenHands hasn't made any changes yet" + Protip card): visible gaps on the right and bottom inside the bordered panel.
  • Diff list (one or more file changes): a small gap on the inner right edge.

Steps to Reproduce

  1. Run the dev server and navigate to http://localhost:3001.
  2. From the home page, click New Conversation.
  3. The Changes tab is selected by default. Observe gaps on the right and bottom inside the bordered panel (empty state).
  4. Trigger a change in the workspace (e.g., have the agent create a file). Observe a small inner-right gap on the diff list.

Current Behavior

The Changes tab content is inset from the bordered panel by 6–16 px on the right and 16 px on the bottom in the empty state, and by 6 px on the right in the diff-list state.

Expected Behavior

Content fills the bordered panel edge-to-edge along all four inner edges. The Protip sits flush against the bottom and side borders. The diff list extends to the right border (the scrollbar gutter only appears when content actually overflows).

Root Cause

In src/routes/changes-tab.tsx:

  • <main> set overflow-y-scroll (always reserves a scrollbar gutter even when there is nothing to scroll) and md:pr-1.5 (6 px right padding).
  • The empty state used absolute positioning (absolute inset-x-0 top-1/2 -translate-y-1/2 for the icon, absolute inset-x-0 bottom-0 for the Protip), and the Protip card carried mb-4 plus max-w-2xl mx-auto. Together these produced the bottom and side gaps inside the empty-state branch.
  • The diff branch kept md:pr-1.5, which was the small inner-right gap when changes are present.

The shared layout files (conversation-main.tsx, tab-container.tsx, etc.) match the upstream OpenHands reference and are not the source of the bug.

Fix

In src/routes/changes-tab.tsx:

  • Replace absolute positioning in the empty state with a normal flex flex-col h-full layout — flex-1 icon area on top, full-width Protip wrapper at the bottom.
  • Drop the Protip card's max-w-2xl mx-auto and the wrapper's outer padding so the card spans full width and is flush with the left, right, and bottom borders.
  • Move scroll/scrollbar styling (overflow-y-auto custom-scrollbar-always) into the diff branch only and drop md:pr-1.5 so the diff list is also flush with the right border.

Acceptance Criteria

  • Empty Changes panel: no visible gaps on the top, right, bottom, or left inner edges (other than the panel border itself).
  • Diff Changes panel: no visible gap on the right inner edge when content does not overflow; scrollbar appears in-flow when content does overflow.
  • StatusMessage (loading / not-a-git-repo / runtime-inactive) still centers inside the panel.
  • Existing diff scrolling behavior is preserved when many file changes are present.

Summary

  • The Changes tab on the conversation page rendered content inset from its bordered container — visible dark gaps along the right and bottom in the empty state, and a small right-edge gap once diffs were present.
  • Restructured src/routes/changes-tab.tsx to fill the panel edge-to-edge in both branches:
    • Empty state: swapped absolute positioning for a flex flex-col h-full layout (flex-1 icon area on top, full-width Protip at the bottom). Removed max-w-2xl mx-auto and the surrounding px-4 pb-4 so the Protip card spans full width and is flush with the side and bottom borders.
    • Diff state: dropped md:pr-1.5, switched overflow-y-scroll → overflow-y-auto, and moved custom-scrollbar-always into this branch only so the scrollbar gutter only appears when content actually overflows.
  • Shared layout files (conversation-main.tsx, tab-container.tsx, root-layout.tsx, conversation.tsx) are intentionally untouched — they match the upstream OpenHands reference.

Screenshots

Before

issue

After

output

@hieptl hieptl self-assigned this May 9, 2026
@vercel

vercel Bot commented May 9, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agent-canvas Ready Ready Preview, Comment May 9, 2026 7:55am

Request Review

@all-hands-bot all-hands-bot 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.

Taste Rating: 🟢 Good taste - Elegant solution that eliminates layout complexity

[RISK ASSESSMENT]

  • [Overall PR] ⚠️ Risk Assessment: 🟢 LOW

Frontend-only visual fix with appropriate test coverage. The change simplifies the layout by replacing absolute positioning with flexbox, which is more maintainable and semantically correct. Scrolling behavior is preserved and moved to the appropriate branch. Screenshots demonstrate the fix works as intended.

VERDICT:
✅ Worth merging: Clean fix that solves a real visual bug while simplifying the code

KEY INSIGHT:
Removing absolute positioning in favor of flexbox not only fixes the gap issue but makes the layout more predictable and easier to reason about.

@hieptl
hieptl merged commit 88cd5fc into main May 9, 2026
5 checks passed

This branch was successfully deployed

1 active deployment
Preview — 18bddb74 Deployed May 9, 2026 by vercel[bot]
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Changes tab has unwanted gaps along its inner edges

2 participants