MCPcopy Create free account
hub / github.com/modem-dev/hunk / splitCellPalette

Function splitCellPalette

src/ui/diff/rowStyle.ts:70–108  ·  view source on GitHub ↗
(
  kind: SplitLineCell["kind"],
  theme: AppTheme,
  moveKind?: SplitLineCell["moveKind"],
)

Source from the content-addressed store, hash-verified

68
69/** Pick split-view colors from the semantic diff cell kind. */
70export function splitCellPalette(
71 kind: SplitLineCell["kind"],
72 theme: AppTheme,
73 moveKind?: SplitLineCell["moveKind"],
74) {
75 if (kind === "addition") {
76 return {
77 gutterBg: moveKind ? theme.movedAddedBg : theme.addedBg,
78 contentBg: moveKind ? theme.movedAddedBg : theme.addedBg,
79 signColor: theme.addedSignColor,
80 numberColor: theme.addedSignColor,
81 };
82 }
83
84 if (kind === "deletion") {
85 return {
86 gutterBg: moveKind ? theme.movedRemovedBg : theme.removedBg,
87 contentBg: moveKind ? theme.movedRemovedBg : theme.removedBg,
88 signColor: theme.removedSignColor,
89 numberColor: theme.removedSignColor,
90 };
91 }
92
93 if (kind === "empty") {
94 return {
95 gutterBg: theme.lineNumberBg,
96 contentBg: theme.panelAlt,
97 signColor: theme.muted,
98 numberColor: theme.lineNumberFg,
99 };
100 }
101
102 return {
103 gutterBg: theme.lineNumberBg,
104 contentBg: theme.contextBg,
105 signColor: theme.muted,
106 numberColor: theme.lineNumberFg,
107 };
108}
109
110/** Pick stack-view colors from the semantic diff cell kind. */
111export function stackCellPalette(

Callers 3

renderStaticSplitCellFunction · 0.90
buildWrappedSplitCellFunction · 0.90
renderSplitCellFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected