Skip to content

Commit dbde403

Browse files
authored
Merge pull request #150 from NeuralNomadsAI/dev
Release v0.10.3 - Viewer for Changes, Git Diff and workspace files along with UX fixes
2 parents 230c981 + 3382736 commit dbde403

75 files changed

Lines changed: 6633 additions & 2180 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎AGENTS.md‎

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,35 @@
1515
- Prefer composable primitives (signals, hooks, utilities) over deep inheritance or implicit global state.
1616
- When adding platform integrations (SSE, IPC, SDK), isolate them in thin adapters that surface typed events/actions.
1717

18+
## Multi-Language Support (i18n)
19+
20+
The UI uses a small custom i18n layer (no ICU/messageformat). When building features, never hardcode user-visible strings.
21+
22+
- **Runtime API:** use `useI18n()` in components (`const { t } = useI18n();`) and `tGlobal(...)` in stores/non-component code.
23+
- Implementation: `packages/ui/src/lib/i18n/index.tsx`
24+
- **Where messages live:** `packages/ui/src/lib/i18n/messages/<locale>/` as TypeScript objects (`"flat.dot.keys": "string"`).
25+
- Each locale has an `index.ts` that merges message parts; duplicate keys throw at build time.
26+
- Merge helper: `packages/ui/src/lib/i18n/messages/merge.ts`
27+
- **Adding a new string:** add it to the appropriate `.../messages/en/*.ts` part file, then add the same key to each other locale’s corresponding file.
28+
- Missing translations fall back to English (and finally to the key), so gaps can be easy to miss.
29+
- **Interpolation:** placeholders are simple `{name}` replacements (word characters only). Avoid placeholders like `{file-name}`.
30+
- **Pluralization:** handle manually via separate keys like `something.one` / `something.other` and choose in code.
31+
- **Adding a new language:** add a new `messages/<locale>/` folder + `index.ts`, register it in `packages/ui/src/lib/i18n/index.tsx`, and add it to the language picker in `packages/ui/src/components/folder-selection-view.tsx`.
32+
- **Locale persistence:** the selected locale is stored in app preferences (`locale`) and persisted via the server config (default `~/.config/codenomad/config.json`).
33+
- **Avoid English-only paths:** do not import `enMessages` directly in feature code; always go through `t(...)` so locale changes apply.
34+
35+
## File Length Guidelines (Highlight Only)
36+
37+
We track file size as a refactoring signal. When you touch or create files, highlight oversized files so the team can plan refactors when time permits.
38+
39+
- Source files: warn after ~500 lines; target limit ~800 lines
40+
- Test files: highlight after ~1000 lines
41+
42+
Behavior for agents:
43+
- Do not refactor solely to satisfy these thresholds.
44+
- When a change touches a file that exceeds the warning/limit, mention it in your final response and include the file path and approximate line count.
45+
- When creating new files, aim to stay under the thresholds unless there's a clear reason.
46+
1847
## Tooling Preferences
1948
- Use the `edit` tool for modifying existing files; prefer it over other editing methods.
2049
- Use the `write` tool only when creating new files from scratch.

‎package-lock.json‎

Lines changed: 13 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "codenomad-workspace",
3-
"version": "0.10.2",
3+
"version": "0.10.3",
44
"private": true,
55
"description": "CodeNomad monorepo workspace",
66
"license": "MIT",
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"minServerVersion": "0.10.2",
2+
"minServerVersion": "0.10.3",
33
"latestServerUrl": "https://github.com/NeuralNomadsAI/CodeNomad/releases/latest"
44
}

‎packages/electron-app/electron.vite.config.ts‎

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,40 @@
11
import { defineConfig, externalizeDepsPlugin } from "electron-vite"
22
import solid from "vite-plugin-solid"
33
import { resolve } from "path"
4+
import { copyMonacoPublicAssets } from "../ui/scripts/monaco-public-assets.js"
45

56
const uiRoot = resolve(__dirname, "../ui")
67
const uiSrc = resolve(uiRoot, "src")
78
const uiRendererRoot = resolve(uiRoot, "src/renderer")
89
const uiRendererEntry = resolve(uiRendererRoot, "index.html")
910
const uiRendererLoadingEntry = resolve(uiRendererRoot, "loading.html")
1011

12+
function prepareMonacoPublicAssets() {
13+
return {
14+
name: "prepare-monaco-public-assets",
15+
configureServer(server: any) {
16+
copyMonacoPublicAssets({
17+
uiRendererRoot: uiRendererRoot,
18+
warn: (msg: string) => server.config.logger.warn(msg),
19+
sourceRoots: [
20+
resolve(__dirname, "../../node_modules/monaco-editor/min/vs"),
21+
resolve(uiRoot, "node_modules/monaco-editor/min/vs"),
22+
],
23+
})
24+
},
25+
buildStart(this: any) {
26+
copyMonacoPublicAssets({
27+
uiRendererRoot: uiRendererRoot,
28+
warn: (msg: string) => this.warn(msg),
29+
sourceRoots: [
30+
resolve(__dirname, "../../node_modules/monaco-editor/min/vs"),
31+
resolve(uiRoot, "node_modules/monaco-editor/min/vs"),
32+
],
33+
})
34+
},
35+
}
36+
}
37+
1138
export default defineConfig({
1239
main: {
1340
plugins: [externalizeDepsPlugin()],
@@ -40,7 +67,7 @@ export default defineConfig({
4067
},
4168
renderer: {
4269
root: uiRendererRoot,
43-
plugins: [solid()],
70+
plugins: [solid(), prepareMonacoPublicAssets()],
4471
css: {
4572
postcss: resolve(uiRoot, "postcss.config.js"),
4673
},

‎packages/electron-app/electron/main/main.ts‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,11 @@ async function exchangeBootstrapToken(baseUrl: string, token: string): Promise<b
399399

400400
async function startCli() {
401401
try {
402-
const devMode = process.env.NODE_ENV === "development"
402+
// In desktop dev workflows we always want the CLI to run in dev mode so it:
403+
// - uses plain HTTP
404+
// - proxies UI requests to the renderer dev server
405+
// Monaco's AMD assets are served from that dev server.
406+
const devMode = !app.isPackaged
403407
console.info("[cli] start requested (dev mode:", devMode, ")")
404408
await cliManager.start({ dev: devMode })
405409
} catch (error) {

‎packages/electron-app/electron/main/process-manager.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,8 @@ export class CliProcessManager extends EventEmitter {
390390
}
391391

392392
if (options.dev) {
393-
args.push("--ui-dev-server", "http://localhost:3000", "--log-level", "debug")
393+
const devServer = process.env.VITE_DEV_SERVER_URL || process.env.ELECTRON_RENDERER_URL || "http://localhost:3000"
394+
args.push("--ui-dev-server", devServer, "--log-level", "debug")
394395
}
395396

396397
return args

‎packages/electron-app/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@neuralnomads/codenomad-electron-app",
3-
"version": "0.10.2",
3+
"version": "0.10.3",
44
"description": "CodeNomad - AI coding assistant",
55
"license": "MIT",
66
"author": {

‎packages/server/package-lock.json‎

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎packages/server/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@neuralnomads/codenomad",
3-
"version": "0.10.2",
3+
"version": "0.10.3",
44
"description": "CodeNomad Server",
55
"license": "MIT",
66
"author": {

0 commit comments

Comments
 (0)