Adjusts Commit Graph columns for narrow layouts#5501
Closed
sergeibbb wants to merge 2 commits into
Closed
Conversation
Automatically adjusts column visibility and mode when the graph view is horizontally constrained. Hides SHA and Changes columns, and sets the Graph column to compact mode to improve space utilization. Related column commands in context menus are disabled, and an informational message is displayed to explain the automatic adjustments. Ensures these layout-driven overrides are not persisted as user preferences, preserving custom column settings for wider graph views. (#5500, #5391)
Member
Author
|
Closing since it's already implemented in the new Graph engine |
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adjusts the Commit Graph's columns when the graph view is horizontally narrow: uses a compact graph column and hides the SHA and Changes columns so the limited horizontal space is used effectively. Closes #5500 (sub-issue of #5391).
The trigger is the graph's actual width, not where the details panel is pinned — so an explicit details-on-bottom pin on a wide editor is not treated as narrow, and a genuinely narrow graph gets the treatment regardless of the pin. Reuses the same width breakpoint (with hysteresis) already used for the
autodetails-location decision.Behavior
compactmode, SHA and Changes columns hidden.Implementation
src/webviews/apps/plus/graph/graph-app.ts—isGraphViewNarrowgetter, keyed off the width-driven_autoEffectiveLocationsignal (decoupled from the details-panel pin); passed to the wrapper.src/webviews/apps/plus/graph/graph-wrapper/graph-wrapper.ts:effectiveColumns— applies the narrow overrides, identity-cached to avoid prop churn on unrelated renders.onColumnsChanged— strips the overrides before persisting.effectiveGraphContext— rewrites the column-menu context tokens to the effective state and appends acolumns:narrowtoken; identity-cached (the React engine ingestscontextby reference).contributions.json—enablementguards on the six managed column commands (keyed offcolumns:narrow) + a new disabledgitlens.graph.columnsNarrowInfoinfo-line command.package.json/src/constants.commands.generated.ts— regenerated fromcontributions.json.CHANGELOG.md— entry under Changed.Test plan
Verified live via the vscode-inspector MCP, both engines (React and Lit):
data-vscode-contextcarriescolumns:narrow+ rewritten tokens.columns:narrowtoken, stored settings unaffected.pnpm run build(type-check + unit-test compile) passes clean.🤖 Generated with Claude Code