FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fix table width persistence and component regressions by jnsquire · Pull Request #652 · vscode-elements/elements · GitHub

Repository navigation

Fix table width persistence and component regressions - #652

Open
jnsquire wants to merge 4 commits into
vscode-elements:mainfrom
jnsquire:fix/recent-issue-fixes
Open

jnsquire wants to merge 4 commits into
vscode-elements:mainfrom
jnsquire:fix/recent-issue-fixes

Conversation

jnsquire commented Sep 27, 2026 •
edited
Loading

Copy link
Copy Markdown
Contributor

Fixes #649, #628, #629, and #599.

Changes

  • Tree: Correct VscTreeSelectEvent.detail to match the emitted VscodeTreeItem[]; let unhandled Escape key events bubble normally.
  • Table: Preserve user-resized widths across unchanged columns assignments and replaced body rows. A divider drag calculates from the widths at gesture start, so moving it back restores the original distribution; movement clamps at the shrinkable width available on the opposite side. Default and per-column minimum widths are now applied correctly. The resizable demo includes a trigger for reassigning the initial columns.
  • Scrollable: Make the shadow opt-in; it is rendered only when the shadow property/attribute is enabled.

Table Resize API

  • Set resizable to enable divider dragging; it is false by default.
  • Use columns for initial widths, as a property array or JSON-encoded attribute. Width entries support pixel-like numeric values, px, %, and auto; auto columns divide the remaining table width. Reassigning unchanged values does not reset user-resized widths.
  • Set table-wide min-column-width as the fallback floor for columns without an explicit header minimum. It defaults to 50px; supported size forms include numeric/pixel-like values, px, and %.
  • Set min-width on an individual vscode-table-header-cell to override the table fallback for that column. An explicitly authored min-width="0" opts that column out of a non-zero fallback.
  • Set delayed-resizing to defer body-cell width updates until the drag ends; otherwise body cells track the resize during the drag.
  • Read current widths from the read-only columnWidths getter; it returns percentages in header order.

Guarantees And Limits

  • During resizing, a column being shrunk will not be taken below its configured minimum when the minimums are mutually satisfiable within the table width. A drag beyond available shrink capacity is clamped rather than collapsing columns below their minimum or pushing their width out of the layout.
  • Reversing the pointer movement within the same drag restores the widths from the start of that gesture. Current widths persist when unchanged columns values are reassigned and when body rows are replaced.
  • Minimums constrain resize operations; they do not automatically expand an initially configured column that is already narrower than its minimum. The combined minimum widths should fit within the table width, or there is no layout that can satisfy every minimum.

Validation

TypeScript build passed. Affected scrollable, table, and tree suites: 67 passed, 0 failed, 2 skipped. Prettier, ESLint, and git diff --check passed.

Copilot AI lite review requested due to automatic review settings September 27, 2026 13:32

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Copilot review overview

🔵 Needs a closer look

Three moderate issues remain unresolved in scroll shadow rendering and table observer lifecycle.

Review effort: Lite
Findings: None

What changed in this PR

Fixes tree event behavior, preserves table column widths across rerenders, and makes scroll shadows opt-in.

Changes:

  • Corrects tree selection typing and Escape propagation.
  • Persists and exposes table column widths.
  • Updates scroll shadow behavior and the resizable table demo.

Outstanding findings concern conditional shadow rendering, explicit table shadow opt-in, and reattaching the table mutation observer after reconnecting.

File Description
src/​vscode-tree/​vscode-tree.ts Updates tree event and keyboard behavior.
src/​vscode-tree/​vscode-tree.test.ts Adds tree regression tests.
src/​vscode-table/​vscode-table.ts Preserves widths and observes body mutations.
src/​vscode-table/​vscode-table.test.ts Tests width persistence.
src/​vscode-scrollable/​vscode-scrollable.ts Makes shadows opt-in.
src/​vscode-scrollable/​vscode-scrollable.test.ts Tests shadow behavior.
dev/​vscode-table/​resizable.html Adds a rerender demonstration.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

This branch has not been deployed

No deployments
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

Tree select event detail type mismatch

2 participants


Back | FazBrowse Home | New Git URL