Skip to content

[WRONG BRANCH] fix(tests): isolate interpolation from React runtime - #227

Draft
luvs01 wants to merge 1 commit into
mainfrom
codex/propose-fix-for-missing-react-dependency
Draft

[WRONG BRANCH] fix(tests): isolate interpolation from React runtime#227
luvs01 wants to merge 1 commit into
mainfrom
codex/propose-fix-for-missing-react-dependency

Conversation

@luvs01

@luvs01 luvs01 commented Aug 9, 2026

Copy link
Copy Markdown
Owner

Motivation

  • Root-level tests imported interpolate from gui/src/i18n/shared.ts, which had a top-level react import and caused the root test runner to require React even though the root package does not depend on it.
  • The change aims to remove the test-only runtime dependency on React without changing GUI runtime behavior or adding React to root deps.

Description

  • Added a pure interpolation module at gui/src/i18n/interpolate.ts exporting interpolate, Vars, and TFn for non-React consumers.
  • Re-exported the interpolation API from gui/src/i18n/shared.ts so existing GUI code remains source-compatible.
  • Updated the three affected root tests to import interpolate from gui/src/i18n/interpolate instead of shared.ts to avoid pulling React into the root test process.
  • Small type import adjustment in shared.ts to keep tsc/vite happy about unused values.

Testing

  • Ran the three affected root tests with the nested GUI node_modules hidden using OCX_TEST_NO_QUEUE=1 bun scripts/test.ts tests/volcengine-providers.test.ts tests/tencent-siliconflow-providers.test.ts tests/provider-workspace-data.test.ts and observed all related tests pass (68 tests across those files passed).
  • Ran bun run typecheck which completed successfully.
  • Ran GUI checks cd gui && bun run lint && bun run build && bun run lint:i18n which completed successfully.
  • Ran bun run privacy:scan which passed.
  • A full bun run test was started but the overall suite still surfaced unrelated existing failures/timeouts in other tests (pre-existing environment/version issues), so an entirely green full-suite run was not obtained in this environment.

Codex Task

Summary by CodeRabbit

  • New Features

    • Improved translation support with placeholders that can be replaced by dynamic text or numeric values.
    • Translations now gracefully remain unchanged when replacement values are unavailable.
  • Refactor

    • Consolidated localization interpolation behavior for more consistent use across the application.
  • Tests

    • Updated localization-related tests to use the consolidated interpolation support.

@github-actions

github-actions Bot commented Aug 9, 2026

Copy link
Copy Markdown

Deterministic PR hygiene checks passed.

@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 82ef6b12-f800-494e-b411-f46fe95a004e

📥 Commits

Reviewing files that changed from the base of the PR and between 121f1ad and 5bc0935.

📒 Files selected for processing (5)
  • gui/src/i18n/interpolate.ts
  • gui/src/i18n/shared.ts
  • tests/provider-workspace-data.test.ts
  • tests/tencent-siliconflow-providers.test.ts
  • tests/volcengine-providers.test.ts

📝 Walkthrough

Walkthrough

The PR extracts i18n interpolation utilities into interpolate.ts, re-exports them from shared.ts, and updates three provider test files to use the dedicated module.

Changes

i18n interpolation extraction

Layer / File(s) Summary
Dedicated interpolation module
gui/src/i18n/interpolate.ts
Lines 1–11 add Vars, TFn, and interpolate. The function performs sequential {key} substitutions and returns the original string when variables are absent.
Shared exports and test imports
gui/src/i18n/shared.ts, tests/provider-workspace-data.test.ts, tests/tencent-siliconflow-providers.test.ts, tests/volcengine-providers.test.ts
Lines 8–10 in shared.ts re-export the extracted utilities. Lines 53–56 remove the local declarations and implementation. The three tests update their imports without changing test logic.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: ingwannu, yrooogerg, wibias

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the primary change: isolating test interpolation from the React runtime dependency.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/propose-fix-for-missing-react-dependency

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added the bug Something isn't working label Aug 9, 2026
@github-actions

github-actions Bot commented Aug 9, 2026

Copy link
Copy Markdown

⏳ DRAFT

  • wrong target branch (main); retarget to dev. UI screenshot required.

What to do

  • Retarget this PR to dev — all contributions go to dev.
  • Add a screenshot of the UI change to the PR description.

Its title has been prefixed with [WRONG BRANCH].
This pull request was already a draft. Its draft status will be preserved after every issue above is resolved.

@github-actions github-actions Bot changed the title fix(tests): isolate interpolation from React runtime [WRONG BRANCH] fix(tests): isolate interpolation from React runtime Aug 9, 2026
@github-actions
github-actions Bot marked this pull request as draft August 9, 2026 07:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

aardvark bug Something isn't working codex

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant