-
Notifications
You must be signed in to change notification settings - Fork 734
Hide "Mark as Viewed" checkboxes on files under commit nodes #8418
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
6d6baff
76b9db0
f1f1684
d5a0086
65bef86
be5620f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -75,7 +75,7 @@ export class FileChangeNode extends TreeNode implements vscode.TreeItem { | |||||||||||||||||||||||||||||
| public command: vscode.Command; | ||||||||||||||||||||||||||||||
| public opts: vscode.TextDocumentShowOptions; | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| public checkboxState: { state: vscode.TreeItemCheckboxState; tooltip?: string; accessibilityInformation: vscode.AccessibilityInformation }; | ||||||||||||||||||||||||||||||
| public checkboxState?: { state: vscode.TreeItemCheckboxState; tooltip?: string; accessibilityInformation: vscode.AccessibilityInformation }; | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| get status(): GitChangeType { | ||||||||||||||||||||||||||||||
| return this.changeModel.status; | ||||||||||||||||||||||||||||||
|
|
@@ -155,13 +155,28 @@ export class FileChangeNode extends TreeNode implements vscode.TreeItem { | |||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| /** | ||||||||||||||||||||||||||||||
| * Check if this file node is under a commit node in the tree hierarchy. | ||||||||||||||||||||||||||||||
| * Files under commit nodes should not have checkboxes. | ||||||||||||||||||||||||||||||
| */ | ||||||||||||||||||||||||||||||
| private isUnderCommitNode(): boolean { | ||||||||||||||||||||||||||||||
| // If the file's sha is different from the PR's head sha, it's from an older commit | ||||||||||||||||||||||||||||||
| // and should not have a checkbox | ||||||||||||||||||||||||||||||
| return this.changeModel.sha !== undefined && this.changeModel.sha !== this.pullRequest.head?.sha; | ||||||||||||||||||||||||||||||
|
Comment on lines
+163
to
+165
|
||||||||||||||||||||||||||||||
| // If the file's sha is different from the PR's head sha, it's from an older commit | |
| // and should not have a checkbox | |
| return this.changeModel.sha !== undefined && this.changeModel.sha !== this.pullRequest.head?.sha; | |
| let parent: TreeNodeParent | undefined = this.getParent(); | |
| while (parent) { | |
| if (parent.contextValue === 'commit') { | |
| return true; | |
| } | |
| parent = parent.getParent(); | |
| } | |
| return false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
allChildrenViewed()now treats a file withcheckboxState === undefinedas “not viewed”, which causes directory nodes to still show an unchecked checkbox even when their children are intentionally non-checkable (e.g., files under commit nodes). In that scenario the directory checkbox becomes misleading and may not trigger any bulk mark/unmark behavior because there are no checkable descendants. Consider hiding the directory checkbox entirely (setthis.checkboxState = undefined) when any descendant lackscheckboxState(or when there are zero checkable leaf nodes).