Skip to content

feat: add per-file-status theme colors for files panel#5468

Open
PeterTimCousins wants to merge 1 commit intojesseduffield:masterfrom
PeterTimCousins:feat/per-status-file-colors
Open

feat: add per-file-status theme colors for files panel#5468
PeterTimCousins wants to merge 1 commit intojesseduffield:masterfrom
PeterTimCousins:feat/per-status-file-colors

Conversation

@PeterTimCousins
Copy link
Copy Markdown

Summary

Adds configurable theme colors for each git file status type in the files panel. Currently, all file statuses share unstagedChangesColor (or hardcoded colors). This PR lets users set distinct colors per status — for example, amber for modified, red for deleted, green for untracked.

Each new color key falls back to unstagedChangesColor (or a sensible default) when not configured, so existing configs are unaffected.

New theme config keys

Key Status Default fallback
modifiedColor Modified (M) unstagedChangesColor
deletedColor Deleted (D) unstagedChangesColor
untrackedColor Untracked (?) unstagedChangesColor
addedColor Added (A) green
renamedColor Renamed (R) unstagedChangesColor
copiedColor Copied (C) cyan

Example config

gui:
  theme:
    modifiedColor:
      - '#e0af68'
    deletedColor:
      - '#f7768e'
    untrackedColor:
      - '#9ece6a'
    addedColor:
      - '#9ece6a'
    renamedColor:
      - '#7dcfff'
    copiedColor:
      - '#7dcfff'

Files changed

  • pkg/config/user_config.go — new color fields on ThemeConfig + defaults
  • pkg/theme/theme.go — new theme variables + fallback logic in UpdateTheme()
  • pkg/gui/presentation/files.gocolorForStatusChar() maps each status char to its theme color, getColorForChangeStatus() updated to use theme colors

Add configurable colors for each git file status character (modified,
deleted, untracked, added, renamed, copied) in the theme config. Each
color falls back to unstagedChangesColor when not set, preserving
existing behavior.

New theme config keys:
- modifiedColor: color for modified files (M)
- deletedColor: color for deleted files (D)
- untrackedColor: color for untracked files (?)
- addedColor: color for added/staged new files (A)
- renamedColor: color for renamed files (R)
- copiedColor: color for copied files (C)

Example config:
  gui:
    theme:
      modifiedColor:
        - '#e0af68'
      deletedColor:
        - '#f7768e'
      untrackedColor:
        - '#9ece6a'
@codacy-production
Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 16 complexity · 0 duplication

Metric Results
Complexity 16
Duplication 0

View in Codacy

TIP This summary will be updated as you push new changes. Give us feedback

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.

1 participant