Skip to content

Commit 30d832f

Browse files
authored
style: run make fmt on main (#115)
Applied consistent whitespace and JSX wrapping to improve readability. Aligned tooltip link formatting and string literals with project standards. Cleaned doc markdown spacing to avoid stray blank lines and indentation.
1 parent d6cbe2e commit 30d832f

22 files changed

+190
-175
lines changed

docs/AGENTS.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,15 @@ Write PR bodies for **busy reviewers**. Be concise and avoid redundancy:
7171
- **If it's obvious, omit it** - Problem obvious from solution? Don't state it. Solution obvious from problem? Skip to implementation details.
7272

7373
**Bad** (redundant):
74+
7475
```
7576
Problem: Markdown rendering is slow, causing 50ms tasks
7677
Solution: Make markdown rendering faster
7778
Impact: Reduces task time to <16ms
7879
```
7980

8081
**Good** (each section adds value):
82+
8183
```
8284
ReactMarkdown was re-parsing content on every parent render because plugin arrays
8385
were created fresh each time. Moved to module scope for stable references.
@@ -104,8 +106,8 @@ Verify with React DevTools Profiler - MarkdownCore should only re-render when co
104106
- User docs are built with mdbook and deployed to https://cmux.io
105107
- Must be added to `docs/SUMMARY.md` to appear in the docs
106108
- Use standard markdown + mermaid diagrams
107-
- **Developer docs** → inline with the code its documenting as comments. Consider them notes as notes to future Assistants to understand the logic more quickly.
108-
**DO NOT** create standalone documentation files in the project root or random locations.
109+
- **Developer docs** → inline with the code its documenting as comments. Consider them notes as notes to future Assistants to understand the logic more quickly.
110+
**DO NOT** create standalone documentation files in the project root or random locations.
109111

110112
### External API Docs
111113

@@ -162,10 +164,10 @@ This project uses **Make** as the primary build orchestrator. See `Makefile` for
162164

163165
### Test-Driven Development (TDD)
164166

165-
**TDD is the preferred development style for agents.**
167+
**TDD is the preferred development style for agents.**
166168

167169
- Prefer relocated complex logic into places where they're easily tested
168-
- E.g. pure functions in `utils` are easier to test than complex logic in a React component
170+
- E.g. pure functions in `utils` are easier to test than complex logic in a React component
169171
- Strive for broad coverage with minimal tests
170172
- Prefer testing large blocks of composite logic
171173
- Tests should be written with the end-user experience in mind

docs/vim-mode.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,13 @@ Vim mode is always enabled. Press **ESC** to enter normal mode from insert mode.
1515
## Modes
1616

1717
### Insert Mode (Default)
18+
1819
- This is the default mode when typing in the chat input
1920
- Type normally, all characters are inserted
2021
- Press **ESC** or **Ctrl-[** to enter normal mode
2122

2223
### Normal Mode
24+
2325
- Command mode for navigation and editing
2426
- Indicated by "NORMAL" text above the input
2527
- Pending commands are shown (e.g., "NORMAL d" when delete is pending)
@@ -28,12 +30,14 @@ Vim mode is always enabled. Press **ESC** to enter normal mode from insert mode.
2830
## Navigation
2931

3032
### Basic Movement
33+
3134
- **h** - Move left one character
3235
- **j** - Move down one line
3336
- **k** - Move up one line
3437
- **l** - Move right one character
3538

3639
### Word Movement
40+
3741
- **w** - Move forward to start of next word
3842
- **W** - Move forward to start of next WORD (whitespace-separated)
3943
- **b** - Move backward to start of previous word
@@ -42,12 +46,14 @@ Vim mode is always enabled. Press **ESC** to enter normal mode from insert mode.
4246
- **E** - Move to end of current/next WORD
4347

4448
### Line Movement
49+
4550
- **0** - Move to beginning of line
4651
- **$** - Move to end of line
4752
- **Home** - Same as **0**
4853
- **End** - Same as **$**
4954

5055
### Column Preservation
56+
5157
When moving up/down with **j**/**k**, the cursor attempts to stay in the same column position. If a line is shorter, the cursor moves to the end of that line, but will return to the original column on longer lines.
5258

5359
## Entering Insert Mode
@@ -62,15 +68,18 @@ When moving up/down with **j**/**k**, the cursor attempts to stay in the same co
6268
## Editing Commands
6369

6470
### Simple Edits
71+
6572
- **x** - Delete character under cursor
6673
- **p** - Paste after cursor
6774
- **P** - Paste before cursor
6875

6976
### Undo/Redo
77+
7078
- **u** - Undo last change
7179
- **Ctrl-r** - Redo
7280

7381
### Line Operations
82+
7483
- **dd** - Delete line (yank to clipboard)
7584
- **yy** - Yank (copy) line
7685
- **cc** - Change line (delete and enter insert mode)
@@ -80,18 +89,21 @@ When moving up/down with **j**/**k**, the cursor attempts to stay in the same co
8089
Vim's power comes from combining operators with motions. All operators work with all motions:
8190

8291
### Operators
92+
8393
- **d** - Delete
8494
- **c** - Change (delete and enter insert mode)
8595
- **y** - Yank (copy)
8696

8797
### Motions
98+
8899
- **w** - To next word
89100
- **b** - To previous word
90101
- **e** - To end of word
91102
- **$** - To end of line
92103
- **0** - To beginning of line
93104

94105
### Examples
106+
95107
- **dw** - Delete to next word
96108
- **de** - Delete to end of word
97109
- **d$** - Delete to end of line
@@ -103,6 +115,7 @@ Vim's power comes from combining operators with motions. All operators work with
103115
- **yy** - Yank line (doubled operator)
104116

105117
### Shortcuts
118+
106119
- **D** - Same as **d$** (delete to end of line)
107120
- **C** - Same as **c$** (change to end of line)
108121

@@ -111,6 +124,7 @@ Vim's power comes from combining operators with motions. All operators work with
111124
Text objects let you operate on semantic units:
112125

113126
### Inner Word (iw)
127+
114128
- **diw** - Delete inner word (word under cursor)
115129
- **ciw** - Change inner word
116130
- **yiw** - Yank inner word
@@ -125,13 +139,13 @@ Text objects work from anywhere within the word - you don't need to be at the st
125139
## Keybind Conflicts
126140

127141
### ESC Key
142+
128143
ESC is used for:
144+
129145
1. Exiting Vim normal mode (highest priority)
130146
2. NOT used for canceling edits (use **Ctrl-Q** instead)
131147
3. NOT used for interrupting streams (use **Ctrl-C** instead)
132148

133-
134-
135149
## Tips
136150

137151
1. **Learn operators + motions**: Instead of memorizing every command, learn the operators (d, c, y) and motions (w, b, $, 0). They combine naturally.
@@ -143,6 +157,7 @@ ESC is used for:
143157
## Not Yet Implemented
144158

145159
Features that may be added in the future:
160+
146161
- **ge** - Backward end of word motion
147162
- **f{char}**, **t{char}** - Find character motions
148163
- **i"**, **i'**, **i(**, **i[**, **i{** - More text objects

src/components/AIView.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,12 @@ const AIViewInner: React.FC<AIViewProps> = ({
320320
}
321321

322322
return (
323-
<ChatProvider messages={messages} cmuxMessages={cmuxMessages} model={currentModel} workspaceId={workspaceId}>
323+
<ChatProvider
324+
messages={messages}
325+
cmuxMessages={cmuxMessages}
326+
model={currentModel}
327+
workspaceId={workspaceId}
328+
>
324329
<ViewContainer className={className}>
325330
<ChatArea>
326331
<ViewHeader>

src/components/ChatInput.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -742,7 +742,8 @@ export const ChatInput: React.FC<ChatInputProps> = ({
742742
<TooltipWrapper inline>
743743
<HelpIndicator>?</HelpIndicator>
744744
<Tooltip className="tooltip" align="left" width="wide">
745-
<strong>Click to edit</strong> or use {formatKeybind(KEYBINDS.OPEN_MODEL_SELECTOR)}
745+
<strong>Click to edit</strong> or use{" "}
746+
{formatKeybind(KEYBINDS.OPEN_MODEL_SELECTOR)}
746747
<br />
747748
<br />
748749
<strong>Abbreviations:</strong>

src/components/ChatMetaSidebar/CostsTab.tsx

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,6 @@ const SectionHeader = styled.div`
237237
margin-bottom: 12px;
238238
`;
239239

240-
241-
242240
// Format token display - show k for thousands with 1 decimal
243241
const formatTokens = (tokens: number) =>
244242
tokens >= 1000 ? `${(tokens / 1000).toFixed(1)}k` : tokens.toLocaleString();
@@ -263,11 +261,7 @@ const formatCostWithDollar = (cost: number | undefined): string => {
263261
* Calculate cost with elevated pricing for 1M context (200k-1M tokens)
264262
* For tokens above 200k, use elevated pricing rates
265263
*/
266-
const calculateElevatedCost = (
267-
tokens: number,
268-
standardRate: number,
269-
isInput: boolean
270-
): number => {
264+
const calculateElevatedCost = (tokens: number, standardRate: number, isInput: boolean): number => {
271265
if (tokens <= 200_000) {
272266
return tokens * standardRate;
273267
}
@@ -408,19 +402,19 @@ export const CostsTab: React.FC = () => {
408402
adjustedInputCost = calculateElevatedCost(
409403
displayUsage.input.tokens,
410404
modelStats.input_cost_per_token,
411-
true // isInput
405+
true // isInput
412406
);
413407
// Recalculate output cost with elevated pricing
414408
adjustedOutputCost = calculateElevatedCost(
415409
displayUsage.output.tokens,
416410
modelStats.output_cost_per_token,
417-
false // isOutput
411+
false // isOutput
418412
);
419413
// Recalculate reasoning cost with elevated pricing
420414
adjustedReasoningCost = calculateElevatedCost(
421415
displayUsage.reasoning.tokens,
422416
modelStats.output_cost_per_token,
423-
false // isOutput
417+
false // isOutput
424418
);
425419
}
426420

src/components/ChatToggles.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,7 @@ interface ChatTogglesProps {
1515
children: React.ReactNode;
1616
}
1717

18-
export const ChatToggles: React.FC<ChatTogglesProps> = ({
19-
workspaceId,
20-
modelString,
21-
children,
22-
}) => {
18+
export const ChatToggles: React.FC<ChatTogglesProps> = ({ workspaceId, modelString, children }) => {
2319
return (
2420
<TogglesContainer>
2521
{children}

src/components/Context1MCheckbox.tsx

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,18 @@ const Checkbox = styled.input`
3535
border-radius: 2px;
3636
background: #1e1e1e;
3737
position: relative;
38-
38+
3939
&:hover {
4040
border-color: #007acc;
4141
}
42-
42+
4343
&:checked {
4444
background: #007acc;
4545
border-color: #007acc;
4646
}
47-
47+
4848
&:checked::after {
49-
content: '';
49+
content: "";
5050
position: absolute;
5151
left: 3px;
5252
top: 0px;
@@ -77,15 +77,22 @@ export const Context1MCheckbox: React.FC<Context1MCheckboxProps> = ({
7777
return (
7878
<CheckboxContainer>
7979
<CheckboxLabel>
80-
<Checkbox
81-
type="checkbox"
82-
checked={use1M}
83-
onChange={(e) => setUse1M(e.target.checked)}
84-
/>
80+
<Checkbox type="checkbox" checked={use1M} onChange={(e) => setUse1M(e.target.checked)} />
8581
1M Context
8682
</CheckboxLabel>
8783
<TooltipWrapper inline>
88-
<span style={{ cursor: "help", color: "#888", fontSize: "10px", lineHeight: "1", display: "flex", alignItems: "center" }}>?</span>
84+
<span
85+
style={{
86+
cursor: "help",
87+
color: "#888",
88+
fontSize: "10px",
89+
lineHeight: "1",
90+
display: "flex",
91+
alignItems: "center",
92+
}}
93+
>
94+
?
95+
</span>
8996
<Tooltip className="tooltip" align="center" width="auto">
9097
Enable 1M token context window (beta feature for Claude Sonnet 4/4.5)
9198
</Tooltip>

src/components/Messages/MarkdownCore.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const REHYPE_PLUGINS = [rehypeKatex];
2020
/**
2121
* Core markdown rendering component that handles all markdown processing.
2222
* This is the single source of truth for markdown configuration.
23-
*
23+
*
2424
* Memoized to prevent expensive re-parsing when content hasn't changed.
2525
*/
2626
export const MarkdownCore = React.memo<MarkdownCoreProps>(({ content, children }) => {

src/components/Messages/MarkdownRenderer.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,10 @@ interface PlanMarkdownRendererProps {
3838
className?: string;
3939
}
4040

41-
export const PlanMarkdownRenderer: React.FC<PlanMarkdownRendererProps> = ({ content, className }) => {
41+
export const PlanMarkdownRenderer: React.FC<PlanMarkdownRendererProps> = ({
42+
content,
43+
className,
44+
}) => {
4245
return (
4346
<PlanMarkdownContainer className={className}>
4447
<MarkdownCore content={content} />

src/components/Messages/ToolMessage.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,7 @@ function isBashTool(toolName: string, args: unknown): args is BashToolArgs {
3737
// Type guard for file_read tool
3838
function isFileReadTool(toolName: string, args: unknown): args is FileReadToolArgs {
3939
return (
40-
toolName === "file_read" &&
41-
typeof args === "object" &&
42-
args !== null &&
43-
"filePath" in args
40+
toolName === "file_read" && typeof args === "object" && args !== null && "filePath" in args
4441
);
4542
}
4643

0 commit comments

Comments
 (0)