Skip to content

Optimize retrieval pipeline and stabilize Next.js lint/type checks#2

Merged
voidcommit-afk merged 4 commits intomainfrom
development
Mar 14, 2026
Merged

Optimize retrieval pipeline and stabilize Next.js lint/type checks#2
voidcommit-afk merged 4 commits intomainfrom
development

Conversation

@voidcommit-afk
Copy link
Owner

@voidcommit-afk voidcommit-afk commented Mar 14, 2026

This pull request includes several improvements and fixes across the API route handlers, UI components, and utility files. The main themes are improved robustness in API request handling, enhanced translation selection persistence in the chat, and various UI and code quality refinements.

API Route Improvements:

Chat Translation Persistence:

  • Refactored the translation selection logic in Chat.tsx to use a default and a list of valid translations, and to persist the user's choice in localStorage more reliably. The initialization now happens in the state hook, and updates to the storage occur only when the selection changes, simplifying the effect logic. [1] [2] [3] [4]

UI and Accessibility Fixes:

  • Fixed encoding issues and improved accessibility in various UI components, such as using " for quotes and Strong's for apostrophes, and updating prop names for clarity (e.g., ref to verseRef). [1] [2] [3] [4] [5] [6]

Popover and Accordion Component Enhancements:

  • Refactored the Popover component to simplify context management, improve ref handling, and ensure correct accessibility attributes and event propagation. Also, fixed the AccordionTrigger type to accept the correct props. [1] [2] [3] [4] [5] [6]

Code Quality and Maintainability:

  • Minor cleanups such as using destructuring for parameters, memoizing context values, and removing redundant code to improve maintainability and readability.

Let me know if you'd like to discuss any specific change in more detail!## Summary

This PR consolidates the retrieval optimization work and the follow-up lint/type/build stabilization into a clean, reviewable branch. It improves retrieval observability, caching, ranking, prompt grounding, and rollout benchmarking, and then resolves the React, TypeScript, and Next.js configuration issues needed to keep the branch buildable.

Changes

  • TypeScript config stabilization for Next.js generated type churn
  • Retrieval instrumentation, confidence diagnostics, and ranking improvements
  • Cache, timeout, hydration, and in-flight dedup optimizations in the chat pipeline
  • Prompt contract tightening, citation whitelist enforcement, and context budgeting
  • Benchmark suite, rollout guardrails, and baseline benchmark documentation
  • React hook lint fixes, JSX entity escaping, reserved prop cleanup, route handler typing fixes, and popover ref safety improvements

Verification

Validated with:

npm run lint
npx tsc --noEmit
npm run build

Notes

Next.js may auto-update tsconfig.json or next-env.d.ts during builds by re-adding generated .next type includes/imports. The committed versions in this branch intentionally keep those generated imports out of source control, while still allowing the build to complete successfully.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant