refactor(staging): dark mode polish, theme toggle, i18n restore + debug probe#2095
Conversation
…ility in Conversations
- Home: sun/moon button above the main card flipping `theme.mode` light/dark.
- en.ts + en-4/en-5 chunks: replace auto-generated placeholder values
('Banner desc', 'Hero title', 'Llm desc', etc.) with the real strings
from pre-i18n source for Rewards community, Meeting Bots banner, and
Settings descriptions (account / AI / features sections).
Standalone binary registered in Cargo.toml that loads the live user config and either: - `--mode harness`: drives the full orchestrator (`Agent::from_config` → `run_single`) so we can verify end-to-end whether tool calls fire against the real system prompt + connected integrations. - `--mode raw`: sends a hand-built request straight to the chat provider with a minimal P-format or native tool catalog, to isolate "does the model itself emit tool calls" from harness-side issues. Used to confirm that DeepSeek V4 Flash (non-thinking) follows P-format and native tool protocols correctly when given a clean prompt, and to exercise the orchestrator path for "list my top 5 emails" / "tell me what time it is" reproductions.
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughAdds a new Rust CLI binary (inference-probe), integrates a Redux-driven theme toggle in Home with test updates, applies dark-mode Tailwind refinements to UI components, and updates i18n strings across multiple locale files. ChangesFeature additions and UI refinements
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@app/src/pages/Home.tsx`:
- Around line 178-179: The aria-label and title strings for the theme toggle are
hardcoded; update the Home.tsx toggle to use the component's i18n translator
(e.g., the useTranslation hook's t function or i18n.t) instead of raw English,
using keys like 'theme.toggle.light' and 'theme.toggle.dark' (or existing keys
if available) and select the key based on isDark for both aria-label and title
so both attributes are localized consistently.
In `@src/bin/inference_probe.rs`:
- Line 64: Replace all eprintln! diagnostic calls in this file with structured
debug-level logging (e.g., log::debug! or tracing::debug!) so diagnostics follow
the repo convention; update the imports to bring debug into scope (use
log::debug or use tracing::debug) and keep the existing env_logger::Builder
initialization, then change each eprintln! occurrence (including those inside
main and the probe helper functions that produce diagnostics) to debug!-style
calls with the same message formatting so behavior and messages remain the same
but are emitted via the logging framework.
- Around line 220-224: The log currently prints raw tool-call arguments in the
loop over response.tool_calls (see the eprintln using tc.name and tc.arguments);
remove or redact tc.arguments before logging to avoid exposing secrets — replace
the arguments output with a safe placeholder (e.g. "<redacted>" or a sanitized
summary like argument count) and keep logging only tc.name (and any
non-sensitive metadata) in the eprintln to prevent leaking PII/API keys.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: fcf569b0-b782-42b5-b720-76226bf6d045
📒 Files selected for processing (8)
Cargo.tomlapp/src/components/rewards/RewardsCommunityTab.tsxapp/src/lib/i18n/chunks/en-4.tsapp/src/lib/i18n/chunks/en-5.tsapp/src/lib/i18n/en.tsapp/src/pages/Conversations.tsxapp/src/pages/Home.tsxsrc/bin/inference_probe.rs
- Home.test.tsx: the Home page now reads `theme.mode` via
`useAppSelector` and dispatches `setThemeMode` via `useAppDispatch`.
Extend the existing `vi.mock('../../store/hooks', …)` to expose
`useAppDispatch` and to recognise the theme selector probe so
Home renders again under the test harness.
- Conversations.tsx: restore the sidebar default to `useState(true)`.
Tests in Conversations.render.test.tsx pre-date the sidebar-hidden
UX and rely on the threads pane being visible from first paint; the
default-hidden version left the chat header un-renderable inside the
test environment (empty body), so the safer fix is to revert the
default until the test rewrite lands.
The mock arrows `useAppSelector` / `useAppDispatch` are vi.mock factories returning plain functions, not actual React hooks. The `react-hooks/rules-of-hooks` rule flags the conditional return inside the selector probe as an unsafe hook call. Wrap the vi.mock block in a scoped disable so the file lints clean again.
- Address CodeRabbit feedback on PR tinyhumansai#2095: - Home.tsx theme toggle: route aria-label / title through `t()` so the strings localize. New keys `home.themeToggle.toLight` and `home.themeToggle.toDark` added to en.ts + en-1 chunk. - inference_probe.rs: stop printing raw `tc.arguments` (may contain user content / secrets). Log only the tool name and an argument byte-count. - The other CodeRabbit suggestion (route probe diagnostics through `log::debug!`) is dismissed in-thread: the probe is a hand-run CLI whose explicit purpose is to surface verdicts via stderr; defaulting to log::debug would silence it without RUST_LOG=debug.
…to all locales
- Restore the real pre-i18n wording for the Home promotional-credits
banner:
'home.banners.promoCreditsTitle' →
"You have {amount} of promotional credits."
'home.banners.promoCreditsBody' →
"Give OpenHuman a spin, and when you're ready for more,"
'home.banners.promoCreditsUsage' → "and get 10x more usage."
(Shipped as auto-generated placeholders in tinyhumansai#1986 — UI was rendering
the literal "Promo credits body" / "Promo credits usage".)
- Add the new `home.themeToggle.{toLight,toDark}` keys to all 10
locale chunks (ar, bn, en, es, fr, hi, id, it, pt, ru, zh-CN) so the
i18n coverage gate stays green after PR tinyhumansai#2095's theme toggle landed.
…-cover gate
- Home.test.tsx: two new theme-toggle cases — light → click dispatches
setThemeMode('dark'), dark → click dispatches setThemeMode('light').
Together they cover Home.tsx lines 85, 178-179, 181 (toggleTheme
callback + the aria-label/title/SVG-branch).
- RewardsCommunityTab.test.tsx: smoke test that renders the component
with one unlocked + one locked achievement so the `role.unlocked`
ring ternary on line 248 (added by the dark-mode pass) gets executed.
Summary
theme.modebetween light and dark.inference-probedebug binary so we can drive a single orchestrator turn (Agent::from_config→run_single) or a raw provider chat to debug tool-call dispatch end-to-end.Problem
The staging build had several rough edges introduced during the i18n refactor and the dark-mode pass: visible-but-invisible UI in dark mode (selected thread, rewards cards, discord stats panel), placeholder strings leaking into the UI ("Hero title", "Banner desc"), and no quick way to test whether the chat model was actually emitting tool calls when debugging the harness.
Solution
Targeted source fixes for the dark-mode and i18n regressions (no behaviour rewrites — just adding
dark:variants and replacing placeholder values with the original pre-i18n strings from the source files). The Home theme toggle dispatches the existingsetThemeModeaction soThemeProvidersyncs<html class="dark">automatically. The debug probe is an opt-in standalone bin — it doesn't run unless invoked.Note: pre-push hook auto-applied Prettier/rustfmt formatting; those are committed in a follow-up
chore: apply auto-fixescommit.Submission Checklist
Impact
refresh_delegation_tools/fetch_connected_integrationsare already-public APIs on Agent; no new surface added to the lib.Related
resolveEn()).AI Authored PR Metadata (required for Codex/Linear PRs)
Linear Issue
Commit & Branch
Validation Run
chore: apply auto-fixespnpm tsc --noEmitclean on Home.tsx)cargo check --bin inference-probeclean)Validation Blocked
Behavior Changes
Parity Contract
Duplicate / Superseded PR Handling
Summary by CodeRabbit
New Features
UI Improvements
Localization
Tests