Skip to content

Fix kvlist value column overflow#1054

Merged
barryvdh merged 1 commit intophp-debugbar:masterfrom
shaffe-fr:fix-kvlist-overflow
Apr 9, 2026
Merged

Fix kvlist value column overflow#1054
barryvdh merged 1 commit intophp-debugbar:masterfrom
shaffe-fr:fix-kvlist-overflow

Conversation

@shaffe-fr
Copy link
Copy Markdown
Contributor

The kvlist grid uses 1fr for the value column, which doesn't cap its max width. When a value is very wide (e.g. request_server with many entries), the column grows beyond the container and pushes float: right elements (like editor links) off-screen.

Changing to minmax(0, 1fr) constrains the column to the available space.

Before

image

After

image

@erikn69
Copy link
Copy Markdown
Contributor

erikn69 commented Apr 8, 2026

It works, it makes the links visible,
but strangely it still shows me an empty space at the end
it doesn't affect my visualization

image

@shaffe-fr
Copy link
Copy Markdown
Contributor Author

shaffe-fr commented Apr 8, 2026

Another option: we can combine minmax(0, 1fr) with overflow-x: auto on the dd elements. This makes individual rows scrollable when their content overflows, which fixes the editor links being pushed off-screen and also works better on smaller resolutions.

image image

Can I go ahead with this approach?

The only other way I see is to use position sticky, but it doesn't work well on small resolutions:
image

@erikn69
Copy link
Copy Markdown
Contributor

erikn69 commented Apr 8, 2026

Let's wait for @barryvdh review

@shaffe-fr shaffe-fr force-pushed the fix-kvlist-overflow branch from 4a7dddc to 94f104a Compare April 8, 2026 15:12
@erikn69
Copy link
Copy Markdown
Contributor

erikn69 commented Apr 8, 2026

Now it adds the scrollbars.
image


Try adding

dl.phpdebugbar-widgets-kvlist dd.phpdebugbar-widgets-value pre.sf-dump:has(>.sf-dump-compact) {
  max-width: 90%;
}

@shaffe-fr
Copy link
Copy Markdown
Contributor Author

I pushed a new version where I use max-width: calc(100% - 5px) on collapsed sf-dump blocks instead of 90%, which accounts for the right padding precisely and scales better across resolutions.

@shaffe-fr shaffe-fr force-pushed the fix-kvlist-overflow branch from 94f104a to 6166f5b Compare April 8, 2026 16:16
@barryvdh
Copy link
Copy Markdown
Collaborator

barryvdh commented Apr 9, 2026

Hmm I guess this is okay, but now the scrollbar is in the dd, which is a bit confusing for larger dumps.

Screenshot 2026-04-09 at 10 15 53

Would it make more sense to remove the :has(> .sf-dump-compact) and always apply the limit?

Screenshot 2026-04-09 at 10 18 12

@shaffe-fr shaffe-fr force-pushed the fix-kvlist-overflow branch from 6166f5b to 38980a0 Compare April 9, 2026 08:56
@shaffe-fr
Copy link
Copy Markdown
Contributor Author

@barryvdh It's indeed better without de :has!

@barryvdh barryvdh merged commit a304ace into php-debugbar:master Apr 9, 2026
21 checks passed
@shaffe-fr shaffe-fr deleted the fix-kvlist-overflow branch April 9, 2026 09:37
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