feat(file-explorer): show gitignored files with dimmed italic decoration (#1941)
* feat(file-explorer): show gitignored files with dimmed italic decoration Surfaces `.gitignore`d files in the right-sidebar file explorer with an italicised, dimmed filename and a CircleSlash icon in the same trailing slot used by the git status letter. A tracked change always wins — the ignored decoration only applies when no other git status is present. Gated behind a new `showGitIgnoredFiles` global setting (default on) so heavy SSH workspaces can keep the smaller payload by skipping `--ignored=matching` on `git status`. `ignoredPaths` lives as a peer field on GitStatusResult rather than an extension of GitFileStatus/GitStagingArea, so Source Control's staging-area grouping is untouched. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * chore(file-explorer): trim redundant comments from gitignored decoration Removes duplicated "Why:" explanations that ended up restating the same backward-compat rationale across five files (relay, ssh provider, runtime git commands, RPC handler, renderer git client) plus a few comments that narrated the mechanism the code already shows. Net: -39 lines of comment across 10 files; no behavior change. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * chore(file-explorer): drop remaining comments from gitignored decoration The code reads well without them. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * review: harden gitignored file decorations - clear ignored decoration cache when ignored status is disabled or omitted - keep ignored decoration state scoped across worktree and runtime cleanup - add coverage for local, SSH, runtime, relay, and Explorer precedence --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Co-authored-by: Jinjing <6427696+AmethystLiang@users.noreply.github.com>
This commit is contained in:
co-authored by
Claude Opus 4.7
Jinjing
parent
2e5c03c31e
commit
2ad01ead7d
@@ -0,0 +1,8 @@
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { getDefaultSettings } from './constants'
|
||||
|
||||
describe('getDefaultSettings', () => {
|
||||
it('enables gitignored file decorations by default', () => {
|
||||
expect(getDefaultSettings('/tmp').showGitIgnoredFiles).toBe(true)
|
||||
})
|
||||
})
|
||||
@@ -211,6 +211,7 @@ export function getDefaultSettings(homedir: string): GlobalSettings {
|
||||
terminalScrollbackBytes: 10_000_000,
|
||||
openLinksInApp: true,
|
||||
rightSidebarOpenByDefault: true,
|
||||
showGitIgnoredFiles: true,
|
||||
showTitlebarAppName: true,
|
||||
showTasksButton: true,
|
||||
ctrlTabOrderMode: 'mru',
|
||||
|
||||
@@ -1345,6 +1345,7 @@ export type GlobalSettings = {
|
||||
* until the user explicitly wants worktree-scoped in-app browsing. */
|
||||
openLinksInApp: boolean
|
||||
rightSidebarOpenByDefault: boolean
|
||||
showGitIgnoredFiles?: boolean
|
||||
/** Whether to show the Orca app name in the titlebar. */
|
||||
showTitlebarAppName: boolean
|
||||
/** Why: some users do not use the Tasks feature and prefer to keep the
|
||||
@@ -1970,6 +1971,7 @@ export type GitStatusResult = {
|
||||
// Why: porcelain v2 status already includes upstream/ahead/behind metadata.
|
||||
// Folding it in lets refresh polling avoid a second pair of git subprocesses.
|
||||
upstreamStatus?: GitUpstreamStatus
|
||||
ignoredPaths?: string[]
|
||||
}
|
||||
|
||||
// Why: when hasUpstream is false, ahead/behind are placeholder zeros, not a
|
||||
|
||||
Reference in New Issue
Block a user