feat(tree-view-table-layout): shift-click a chevron to expand/collapse the whole subtree#322
Open
seltzdesign wants to merge 1 commit into
Conversation
…e the whole subtree
The chevron only toggles one level; fully opening/closing a deep branch means clicking
through every node. Shift-click now expands/collapses the entire subtree in one gesture;
a plain click is unchanged.
- table-row.vue: forward the modifier via $emit('toggle-children', $event.shiftKey)
- v-table.vue: onToggleChildren(item, deep=false); when deep, drive the clicked node and
every descendant container to a single target collapsed state
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.
Problem
The expand/collapse chevron only ever toggles one level. Fully opening or closing a deep branch means clicking down (or up) through every intermediate node by hand, which is tedious on large trees.
Fix
Add a power-user gesture: shift-click a chevron to expand or collapse the entire subtree under that node in one action. A plain click is unchanged (single level).
Implementation:
src/components/table-row.vue— the chevron's click handler now forwards the modifier state:$emit('toggle-children', $event.shiftKey). A normal click emitsfalse, a shift-click emitstrue.src/components/v-table.vue—onToggleChildren(item, deep = false)gains adeepflag. Whendeepis true it delegates to a newtoggleChildrenDeep(item), which:internalItems;toggleItem/collapseChildrenprimitives.The template binding is updated to pass the flag through:
@toggle-children="(deep) => onToggleChildren(item, deep)".Defaulting
deeptofalsekeeps the single-level behaviour for every existing caller and for plain clicks.Verification
Note for reviewers
This PR touches
src/components/table-row.vue, but only the@clickemit hunk in the<template>(forwarding$event.shiftKey). A separate PR ("fix: point the collapsed-row chevron right") also touches this file, but in a different, non-overlapping hunk — thetransform: rotate(...)rule in the<style>block. The two changes are independent and do not conflict.