Skip to content

fix(request-panel)/fixed overflow size column issue on first load - #8525

Merged
sid-bruno merged 3 commits into
usebruno:mainfrom
sachin-thakur-bruno:fix/request-panel
Jul 8, 2026
Merged

sid-bruno merged 3 commits into
usebruno:mainfrom
sachin-thakur-bruno:fix/request-panel

Conversation

@sachin-thakur-bruno

@sachin-thakur-bruno sachin-thakur-bruno commented Jul 7, 2026 •

Copy link
Copy Markdown
Collaborator

Description

JIRA

Network tab "Size" column disappears behind the Request Details panel.

In Devtools → Network, resizing the Request Details panel wide enough caused the last column ("Size") in the request list table to vanish — it rendered clipped off, appearing to sit underneath the details panel. Happened reliably on first open (and again after close/reopen) once the panel was dragged near its max width.

Root cause

scaleWidthsToTotal() (in hooks/useResizableColumns/index.js) is responsible for shrinking the 7 table columns so they always sum to exactly the available container width. Its old logic:

  1. Scale every column proportionally to the target width.
  2. Clamp any column below minColWidth (60px) up to minColWidth.
  3. Give the last column whatever's left over.

The bug: when several small columns get clamped up to minColWidth independently, their floors alone can already exceed the container's actual width — before the "leftover" for the last column is even computed. Example, with the real column weights [80, 70, 180, 300, 110, 100, 80] shrunk to a 420px container:

Fix

Reworked scaleWidthsToTotal() into a two-step algorithm:

  1. Scale columns proportionally, pinning any column that would fall below minColWidth and recalculating the remaining space.
  2. Round to whole pixels by distributing leftover pixels to the columns with the largest fractional remainders, ensuring the total matches the container width.

This guarantees:

  • Widths always sum to the container width.

  • No column goes below minColWidth.

  • Existing proportional resize behavior is preserved when no clamping is needed.

  • Added regression tests for the reported 380px/420px cases and a container-width sweep.

  • Verified the existing proportional resize test continues to pass.

Contribution Checklist:

  • I've used AI significantly to create this pull request
  • The pull request only addresses one issue or adds one feature.
  • The pull request does not introduce any breaking changes
  • I have added screenshots or gifs to help explain the change if applicable.
  • I have read the contribution guidelines.
  • Create an issue and link to the pull request.

Note: Keeping the PR small and focused helps make it easier to review and merge. If you have multiple changes you want to make, please consider submitting them as separate pull requests.

Publishing to New Package Managers

Please see here for more information.

Summary by CodeRabbit

  • Bug Fixes

    • Improved column resizing so column widths always total exactly to the container width.
    • Enhanced minimum column width enforcement to prevent overflow and invalid sizing in tight edge cases.
  • Tests

    • Added regression tests covering exact-total width invariants and minimum-width constraints across a range of resize scenarios, including real-world column sets.

@coderabbitai

coderabbitai Bot commented Jul 7, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 6b3d4431-f55c-44fa-8e6e-6259c03c59cb

📥 Commits

Reviewing files that changed from the base of the PR and between 8ca7719 and 596f033.

📒 Files selected for processing (1)
  • packages/bruno-app/src/hooks/useResizableColumns/index.js
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/bruno-app/src/hooks/useResizableColumns/index.js

Walkthrough

The column width scaling logic in useResizableColumns now guarantees exact integer totals while enforcing minimum widths through pinning and largest-remainder redistribution. Regression tests cover width sweeps and edge cases, including narrow containers and evenly weighted columns.

Changes

Column Width Scaling Rewrite

Layer / File(s) Summary
Scaling algorithm rewrite and regression tests
packages/bruno-app/src/hooks/useResizableColumns/index.js, packages/bruno-app/src/hooks/useResizableColumns/index.spec.js
scaleWidthsToTotal now handles under-minimum container widths with even distribution, pins columns that would drop below minColWidth, and allocates remaining pixels with largest-remainder rounding; new tests verify exact total sums and minimum-width invariants across sweeps and edge cases.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

  • usebruno/bruno#8265: Overlaps with prior changes to useResizableColumns container-measurement and minColWidth scaling behavior in the same hook.

Suggested reviewers: helloanoop, bijin-bruno, lohit-bruno, naman-bruno, vijayh-bruno, utkarsh-bruno, sid-bruno

Poem

A column too narrow, a pixel astray,
The widths now align in a tidier way.
Pin, split, and round—no sum left behind,
Min widths stay guarded, each column refined.
Tiny pixels now land where they ought to be,
A neat little chorus of integer harmony.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is clearly related to the main fix: preventing the Size column overflow on first load.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@sid-bruno
sid-bruno merged commit 7af6150 into usebruno:main Jul 8, 2026
13 of 16 checks passed
ravindra-bruno pushed a commit to ravindra-bruno/bruno that referenced this pull request Jul 9, 2026
…ebruno#8525)

* fix(request-panel)/fixed overflow size column issue on first load

* added tests

* refactor the total width calculation based on available space
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants