This repository was archived by the owner on May 13, 2026. It is now read-only.
Fix handler inconsistencies and deduplicate patterns - #31
Merged
Conversation
- Convert 3 log handler response structs to handler_response! macro for consistency with all other handler files (schema, query, mutation, system, ingestion) - Export LOG_LEVELS as pub const and reuse in routes/log.rs instead of duplicating the array inline - Consolidate duplicated perform_smart_folder_scan_with_progress call in smart_folder_routes.rs — extract optional node guard before the single call instead of two identical 6-line call sites Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
shiba4life
enabled auto-merge (squash)
March 14, 2026 05:42
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8e23998643
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
5 tasks
6 tasks
shiba4life
added a commit
that referenced
this pull request
May 1, 2026
…ee to .tsx Make Rust↔TS shape mismatches in the React UI a compile error rather than a runtime React #31. Three coordinated pieces: 1. **Strict TypeScript typecheck.** New `tsconfig.json` (strict, JSX, allowJs for transitional .jsx imports), `npm run typecheck` script, and a `Typecheck (tsc --noEmit)` step in the `frontend-tests` CI job. 16 pre-existing `.ts` files have real type bugs (wrong return types, missing names, modifier mismatches) — fixing them is out of scope for this PR, so they self-opt-out via `// @ts-nocheck — pre-existing strict-mode debt; remove this directive after fixing.` Grep for that string to find the cleanup queue. Eslint's `ban-ts-comment` rule is configured to allow `@ts-nocheck` only with a description ≥10 chars so the directive can't be sprinkled silently in new code. `jsconfig.json` removed (replaced by tsconfig.json). 2. **OpenAPI drift check.** New steps at the end of `rust-fast` that run `cargo run --bin openapi_dump > target/openapi.json`, regenerate `src/types/openapi.ts`, and `git diff --exit-code`. Backend route or schema changes that don't update the TS types now fail PR CI with a one-line fix command. Also pinned `generate:api` to use the locally-installed `openapi-typescript` (was `npx -y`) for deterministic CI runs. 3. **Settings tree converted to .tsx.** `SettingsTab`, `AiConfigSettings`, `DatabaseSettings`, and a shared `components/settings/types.ts` for `SaveStatus` / `SettingsPanelProps`. The bug that prompted this work — a JSX consumer rendering `{success, message}` as a React child — is now a compile error: `Type 'SaveStatus' is not assignable to type 'ReactNode'`. The conversion also surfaced two real shape gaps in `ingestionClient.ts` — `OllamaConfig` was missing `vision_model` / `ocr_model` even though the Rust struct serialises them, and `IngestionConfig` was missing the legacy dual-written `query: UseCaseOverride` field. Added both. The OpenAPI spec is also missing them (utoipa annotation drift) — tracked as a separate finding in the audit feeding gbrain projects/api-typegen-unification. Verification: `npm run typecheck` clean. `npm test` 51 files / 650 tests pass. Local `npm run lint` shows only 3 pre-existing errors in unrelated test files. Reintroducing the original `<span>{configSaveStatus}</span>` bug deliberately produces the expected typecheck error, confirming the guard.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
handler_response!macro for consistency with all other handler files (schema, query, mutation, system, ingestion)LOG_LEVELSaspub constand reuse inroutes/log.rsinstead of duplicating the array inlineperform_smart_folder_scan_with_progresscall insmart_folder_routes.rs— extract optional node guard before a single call instead of two identical 6-line call sitesNet -6 lines (31 added, 37 removed).
Test plan
cargo clippy --workspace --all-targets -- -D warningspassescargo check --workspace --features aws-backendpassescargo test --workspace --all-targets— all tests pass🤖 Generated with Claude Code