Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@
- No trailing whitespace.
- Use `const` and `let` instead of `var`.

## Translations / i18n
- All user-visible strings must go in `src/nls/root/strings.js` — never hardcode English in source files.
- Use `const Strings = require("strings");` then `Strings.KEY_NAME`.
- For parameterized strings use `StringUtils.format(Strings.KEY, arg0, arg1)` with `{0}`, `{1}` placeholders.
- Keys use UPPER_SNAKE_CASE grouped by feature prefix (e.g. `AI_CHAT_*`).
- Only `src/nls/root/strings.js` (English) needs manual edits — other locales are auto-translated by GitHub Actions.
- Never compare `$(el).text()` against English strings for logic — use data attributes or CSS classes instead.

## Phoenix MCP (Desktop App Testing)

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.
Expand Down
12 changes: 8 additions & 4 deletions src-node/claude-code-agent.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ exports.checkAvailability = async function () {
* aiProgress, aiTextStream, aiToolEdit, aiError, aiComplete
*/
exports.sendPrompt = async function (params) {
const { prompt, projectPath, sessionAction, model } = params;
const { prompt, projectPath, sessionAction, model, locale } = params;
const requestId = Date.now().toString(36) + Math.random().toString(36).slice(2, 7);

// Handle session
Expand All @@ -142,7 +142,7 @@ exports.sendPrompt = async function (params) {
currentAbortController = new AbortController();

// Run the query asynchronously — don't await here so we return requestId immediately
_runQuery(requestId, prompt, projectPath, model, currentAbortController.signal)
_runQuery(requestId, prompt, projectPath, model, currentAbortController.signal, locale)
.catch(err => {
console.error("[Phoenix AI] Query error:", err);
});
Expand Down Expand Up @@ -176,7 +176,7 @@ exports.destroySession = async function () {
/**
* Internal: run a Claude SDK query and stream results back to the browser.
*/
async function _runQuery(requestId, prompt, projectPath, model, signal) {
async function _runQuery(requestId, prompt, projectPath, model, signal, locale) {
let editCount = 0;
let toolCounter = 0;
let queryFn;
Expand Down Expand Up @@ -209,7 +209,11 @@ async function _runQuery(requestId, prompt, projectPath, model, signal) {
"to create brand new files that do not exist yet. For existing files, always use " +
"multiple Edit calls to make targeted changes rather than rewriting the entire " +
"file with Write. This is critical because Write replaces the entire file content " +
"which is slow and loses undo history.",
"which is slow and loses undo history." +
(locale && !locale.startsWith("en")
? "\n\nThe user's display language is " + locale + ". " +
"Respond in this language unless they write in a different language."
: ""),
includePartialMessages: true,
abortController: currentAbortController,
hooks: {
Expand Down
1 change: 1 addition & 0 deletions src/brackets.js
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,7 @@ define(function (require, exports, module) {
SidebarTabs: require("view/SidebarTabs"),
SidebarView: require("project/SidebarView"),
WorkingSetView: require("project/WorkingSetView"),
AISnapshotStore: require("core-ai/AISnapshotStore"),
doneLoading: false
};

Expand Down
177 changes: 118 additions & 59 deletions src/core-ai/AIChatPanel.js

Large diffs are not rendered by default.

Loading
Loading