Skip to content

Commit 3d8bf6e

Browse files
committed
chore: muted style for restored edit-card stats; FS API note
Adds a CSS rule for .ai-tool-edit-stats so the per-edit +x/-y on restored cards reads with the same muted grey as the Show diff toggle (the .ai-msg-edit-summary-scoped green/red colors don't apply inside the tool indicator, leaving the default bright text otherwise). CLAUDE.md gains a short note on which file API to reach for — Phoenix.VFS.{read,write,unlink}Async for raw app data (no size cap, recursive dir delete) versus FileSystem.getFileForPath only for files that may be opened as editor documents.
1 parent 7bfd0c0 commit 3d8bf6e

2 files changed

Lines changed: 20 additions & 0 deletions

File tree

CLAUDE.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,15 @@
2323
- **Exception — Markdown viewer iframe** (`src-mdviewer/`): Has its own i18n system. Strings go in `src-mdviewer/src/locales/en.json` (root), not `src/nls/`. Other locale files in that folder are auto-translated by GitHub Actions. Use `t("key")` / `tp("key", { param })` from `src-mdviewer/src/core/i18n.js`.
2424
- Never compare `$(el).text()` against English strings for logic — use data attributes or CSS classes instead.
2525

26+
## File I/O APIs — which to use
27+
28+
Phoenix has two parallel file APIs. Pick the right one for the situation:
29+
30+
- **`Phoenix.VFS.readFileAsync(path, encoding)` / `Phoenix.VFS.writeFileAsync(path, content, encoding)` / `Phoenix.VFS.unlinkAsync(path)`** — for raw app data (config files, session JSONs, caches, snapshots). No size cap. `unlinkAsync` removes non-empty directories recursively.
31+
- **`FileSystem.getFileForPath(path).read/.write/.unlink`** (and `getDirectoryForPath`) — *only* for files that may be opened as documents in the editor. Goes through the document layer (mtime tracking, dirty-buffer reconciliation). Has a 16 MB cap on reads/writes.
32+
33+
If a file is purely app-internal data and never edited by the user as a document, use the VFS APIs. Mixing them on the same file leads to mtime confusion and surprise size limits.
34+
2635
## Phoenix MCP (Desktop App Testing)
2736

2837
Use `exec_js` to run JS in the Phoenix browser runtime. jQuery `$()` is global. `brackets.test.*` exposes internal modules (DocumentManager, CommandManager, ProjectManager, FileSystem, EditorManager). Always `return` a value from `exec_js` to see results. Prefer reusing an already-running Phoenix instance (`get_phoenix_status`) over launching a new one.

src/styles/Extn-AIChatPanel.less

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -688,6 +688,17 @@
688688
}
689689
}
690690

691+
// Per-edit line stats shown next to the Show-diff toggle on
692+
// restored cards. Match the toggle's muted look so the right edge
693+
// reads as a single secondary-action cluster — without this the
694+
// +x/-y use the panel's default bright text and clash.
695+
.ai-tool-edit-stats {
696+
font-size: @ai-text-meta;
697+
color: @project-panel-text-2;
698+
opacity: 0.65;
699+
font-family: 'SourceCodePro-Medium', 'SourceCodePro', monospace;
700+
}
701+
691702
.ai-tool-diff-more {
692703
background: none;
693704
border: none;

0 commit comments

Comments
 (0)