You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit b050536
Browse filesBrowse the repository at this point in the historyBrowse files
`CodexSwitch/` contains the Avalonia desktop app targeting .NET 10 and using MVVM. Keep UI under `Views/` and `Controls/`, state and commands under `ViewModels/`, and business logic in `Services/`, `Proxy/`, `Models/`, and `I18n/`. Static assets live in `CodexSwitch/Assets/`.
6
+
7
+
`CodexSwitch.Tests/` holds xUnit coverage for pricing, routing, config writers, usage parsing, i18n, and update flows. Match new tests to the production subject, for example `PriceCalculatorTests.cs`.
8
+
9
+
`CodexSwitch.AdminWeb/` is the React + Vite admin UI. Source is in `src/`, public assets in `public/`, and production output in `dist/`. `build/` contains release helpers; `docs/` and `docs-site/` hold documentation.
-`dotnet run --project CodexSwitch/CodexSwitch.csproj` — start the desktop app locally.
15
+
-`dotnet build CodexSwitch.Tests/CodexSwitch.Tests.csproj -c Release --no-restore` — build the app and test project.
16
+
-`dotnet test CodexSwitch.Tests/CodexSwitch.Tests.csproj -c Release --no-build --no-restore` — run the full xUnit suite.
17
+
- In `CodexSwitch.AdminWeb/`: `npm run dev`, `npm run build`, and `npm run lint` — develop, bundle, and lint the admin UI. Release builds of the desktop app invoke the admin web build when `package.json` is present.
18
+
19
+
## Coding Style & Naming Conventions
20
+
21
+
Use 4 spaces in C# and XAML. Follow existing formatting in TS/React files. Public types, properties, and methods use PascalCase; private fields use `_camelCase`. Keep nullable annotations enabled and prefer Avalonia compiled bindings. Comments should explain intent, invariants, or non-obvious constraints—not restate code. Use `eslint` for AdminWeb changes and keep imports clean.
22
+
23
+
## Testing Guidelines
24
+
25
+
Write xUnit tests in `CodexSwitch.Tests/` for any behavior change. Name test files after the subject under test and test methods in `Action_ExpectedResult` style, for example `Calculate_AppliesProgressiveTiersAndFastOverride`. Cover routing, protocol conversion, pricing, config writing, usage accounting, and UI-facing service behavior.
26
+
27
+
## Commit & Pull Request Guidelines
28
+
29
+
Recent history mixes conventional commits (`feat:`, `fix:`, `chore:`) with a few free-form messages. Prefer conventional prefixes for all new commits. Keep PRs focused, describe the user-visible impact, link related issues, and include screenshots for UI changes. Before opening a PR, run the relevant .NET tests and `npm run lint` for AdminWeb work.
30
+
31
+
## Security & Configuration Tips
32
+
33
+
Treat config files and exported settings as sensitive; they may contain API keys or OAuth tokens. The local proxy defaults to `127.0.0.1:12785`. Managed config writes create `.bak` backups—preserve them unless the change explicitly replaces the managed file flow.
0 commit comments