Skip to content

feat(dashboard): select optional Xray API services in both core editors - #662

Open
Multi-Engineer-dev wants to merge 13 commits into
PasarGuard:devfrom
multi-engineer:feat/dashboard-xray-api-services
Open

feat(dashboard): select optional Xray API services in both core editors#662
Multi-Engineer-dev wants to merge 13 commits into
PasarGuard:devfrom
multi-engineer:feat/dashboard-xray-api-services

Conversation

@Multi-Engineer-dev

@Multi-Engineer-dev Multi-Engineer-dev commented Jun 28, 2026

Copy link
Copy Markdown

What

Adds first-class support for selecting optional Xray gRPC API services from
the dashboard, in both core-config editors, plus the supporting validation,
persistence, and localization.

Why

Xray exposes optional API services (e.g. RoutingService, ObservatoryService)
beyond the always-on HandlerService / LoggerService / StatsService.
Operators previously had to hand-edit raw JSON to enable them. This adds a
guided, validated control and ensures the selection round-trips correctly
through the structured editor.

What's included

  • Allowlist + helpers (lib/xray-api-services.ts): canonical required and
    optional service lists mirrored from xray-core, with pure helpers to read and
    toggle the selected optional services. Unit tests pin the allowlist so it
    can't drift silently.
  • Legacy core config modal: an "API Services" control to toggle optional
    services, with blocking validation that rejects unknown names and de-dupes
    them, plus accessible label/checkbox associations.
  • Structured core editor: a new "API" section mirroring the same control for
    the default route-based editor.
  • Localization: the structured editor's API section header and card
    (title + hint) are translated across all four locales (en/fa/ru/zh); the
    "API" acronym is kept as-is.
  • Fixes:
    • Toggling a service off now reliably enables Save. The structured editor's
      adapter re-emits api from raw.source, so toggles now update raw.source
      and raw.topLevel in lockstep (setRawOptionalService) — otherwise removing
      the last optional service produced no diff and left Save disabled.
    • The API section header renders proper labels even when a stale PWA-cached
      locale is served, via defaultValue fallbacks on PageHeader.

Tests

  • Unit tests for the allowlist helpers, including regressions for the
    toggle-persistence fix.
  • All four locale files validated (parse + key resolution).
  • esbuild integration check against a real core config, lints, and a
    production build all pass.

Related

Dashboard half of the Xray API services feature, which spans three repos:

  • Node — merges these user-selected services with the node's required ones
    (instead of overwriting), fixes the ObservatoryService startup crash, and adds
    the RoutingService RPCs: Node PR 60.
  • Bridge — Python async wrappers for the routing RPCs over gRPC + REST:
    Bridge PR 16.
    This PR ships the enable/disable toggles; the dashboard UI to use RoutingService
    (manage rules, balancers, test routes) is a follow-up on top of the bridge.

Summary by CodeRabbit

  • New Features
    • Added an API section to the Xray core editor with an “always on” view for required services.
    • Added interactive toggles for optional gRPC API services plus warnings/errors for unrecognized services.
    • Extended UI translations (EN/FA/RU/ZH) and added localized API copy for the core editor and configuration modal.
    • Improved header text with localized fallback title/description support.
  • Tests
    • Added a Node test suite covering API service selection, validation, and config updates.
  • Chores
    • Updated Node.js engine requirement and adjusted ignore rules for local build artifacts.

@coderabbitai

coderabbitai Bot commented Jun 28, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 5fa388f6-9274-4ca1-9080-6c626272829c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Walkthrough

The dashboard adds Xray API service helpers, validation, configuration controls, a dedicated core-editor section, localized UI text, tests, and Node.js test runtime configuration.

Changes

Xray API configuration

Layer / File(s) Summary
API service helpers and tests
dashboard/src/lib/xray-api-services.ts, dashboard/src/lib/xray-api-services.test.ts, dashboard/package.json, .gitignore
API service allowlists, normalization, unknown-service detection, immutable toggling, raw-profile synchronization, Node.js requirements, test execution, and an ignore rule are added.
Core configuration modal integration
dashboard/src/features/nodes/dialogs/core-config-modal.tsx
The modal derives API service state, toggles optional services, rejects unknown services, and renders Xray API service controls.
Core editor API section
dashboard/src/features/core-editor/..., dashboard/src/components/layout/page-header.tsx
The Xray editor gains an API section, navigation entry, rendering branch, profile controls, and localized header fallback support.
API section localization
dashboard/public/statics/locales/*.json
English, Persian, Russian, and Chinese locales define API section labels, descriptions, titles, hints, and validation messages.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant EditorPage
  participant XrayCoreEditor
  participant XrayApiSection
  participant XrayProfile
  participant APIServiceHelpers
  EditorPage->>XrayCoreEditor: select api section
  XrayCoreEditor->>XrayApiSection: mount API controls
  XrayApiSection->>XrayProfile: read raw.topLevel configuration
  XrayApiSection->>APIServiceHelpers: derive selected and unknown services
  APIServiceHelpers-->>XrayApiSection: return service state
  XrayApiSection->>XrayProfile: toggle optional service
Loading

Suggested reviewers: x0sina

Poem

A rabbit checks the API box,
And tidies service lists and locks.
gRPC signals softly glow,
Unknown names are told to go.
Local words bloom bright and new—
The bunny hops with tests in view.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 35.71% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main change: adding optional Xray API service selection in both core editors.
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 unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@ImMohammad20000

Copy link
Copy Markdown
Contributor

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 6

🤖 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 `@dashboard/package.json`:
- Around line 11-12: Update the test script in dashboard/package.json to use a
pinned Node runtime, or replace the node --test invocation with Bun’s test
runner so test execution is deterministic and aligned with the repository’s
existing Bun version pin.

In `@dashboard/public/statics/locales/en.json`:
- Around line 2236-2238: Add the missing alwaysOn and unknown localization keys
to the api objects in dashboard/public/statics/locales/en.json (2236-2238),
dashboard/public/statics/locales/fa.json (2151-2153), and
dashboard/public/statics/locales/ru.json (2125-2127), using the exact English,
Persian, and Russian translations specified in the review comment and preserving
the {{names}} interpolation placeholder.

In `@dashboard/public/statics/locales/zh.json`:
- Around line 2196-2199: Add the missing coreEditor.api.alwaysOn and
coreEditor.api.unknown translation keys to the api locale sections in fa.json,
ru.json, and zh.json, using appropriate translations consistent with each
locale’s existing terminology and the English defaults.

In `@dashboard/src/features/nodes/dialogs/core-config-modal.tsx`:
- Around line 153-164: Gate the API-service derivation in the useMemo containing
selectedApiServices and unknownApiServices with isXrayBackend (or backendType
!== 'wg'), returning empty API-service lists for WireGuard configurations. Apply
the same Xray-only guard to the submit validation near the related submission
logic so unknown API services cannot block wg configurations, while preserving
existing Xray validation.
- Around line 166-175: Update handleToggleApiService to validate that the parsed
JSON is a non-null object before passing it to setOptionalService; return early
for null, arrays, and primitive values while preserving the existing behavior
for valid configuration objects.

In `@dashboard/src/lib/xray-api-services.ts`:
- Around line 66-68: Restrict the helper using CANONICAL_API_SERVICES to the
optional-services set so required services such as HandlerService are ignored
and the existing config is returned unchanged. Add tests covering both enabling
and disabling a required service, asserting each operation is a no-op.
🪄 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: 83f34bfa-3e98-4edd-8dd7-7b2cfc574bf4

📥 Commits

Reviewing files that changed from the base of the PR and between f3b64bb and e9152f2.

📒 Files selected for processing (15)
  • .gitignore
  • dashboard/package.json
  • dashboard/public/statics/locales/en.json
  • dashboard/public/statics/locales/fa.json
  • dashboard/public/statics/locales/ru.json
  • dashboard/public/statics/locales/zh.json
  • dashboard/src/components/layout/page-header.tsx
  • dashboard/src/features/core-editor/components/xray/xray-api-section.tsx
  • dashboard/src/features/core-editor/components/xray/xray-core-editor.tsx
  • dashboard/src/features/core-editor/kit/core-section-nav.ts
  • dashboard/src/features/core-editor/routes/core-editor-page.tsx
  • dashboard/src/features/core-editor/state/core-editor-store.ts
  • dashboard/src/features/nodes/dialogs/core-config-modal.tsx
  • dashboard/src/lib/xray-api-services.test.ts
  • dashboard/src/lib/xray-api-services.ts

Comment thread dashboard/package.json
Comment on lines +2236 to +2238
"api": {
"title": "API Services",
"hint": "gRPC API services exposed by this core. The node always enables the required services; enable optional ones as needed."

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Missing localization keys for the API section.

The translation keys alwaysOn and unknown are utilized in the xray-api-section.tsx component via t('coreEditor.api.alwaysOn', ...) and t('coreEditor.api.unknown', ...), but they were omitted from the localization bundles. Although fallback values are provided in the code, missing keys prevent proper localization.

  • dashboard/public/statics/locales/en.json#L2236-L2238: add "alwaysOn": "always on" and "unknown": "Unrecognized API service(s): {{names}}. Fix them in the Advanced tab." to the api object.
  • dashboard/public/statics/locales/fa.json#L2151-L2153: add "alwaysOn": "همیشه روشن" and "unknown": "سرویس(های) API ناشناخته: {{names}}. آن‌ها را در تب پیشرفته اصلاح کنید." to the api object.
  • dashboard/public/statics/locales/ru.json#L2125-L2127: add "alwaysOn": "всегда включено" and "unknown": "Нераспознанные сервисы API: {{names}}. Исправьте их на вкладке «Дополнительно»." to the api object.
📍 Affects 3 files
  • dashboard/public/statics/locales/en.json#L2236-L2238 (this comment)
  • dashboard/public/statics/locales/fa.json#L2151-L2153
  • dashboard/public/statics/locales/ru.json#L2125-L2127
🤖 Prompt for 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.

In `@dashboard/public/statics/locales/en.json` around lines 2236 - 2238, Add the
missing alwaysOn and unknown localization keys to the api objects in
dashboard/public/statics/locales/en.json (2236-2238),
dashboard/public/statics/locales/fa.json (2151-2153), and
dashboard/public/statics/locales/ru.json (2125-2127), using the exact English,
Persian, and Russian translations specified in the review comment and preserving
the {{names}} interpolation placeholder.

Comment on lines +2196 to 2199
"api": {
"title": "API 服务",
"hint": "此核心提供的 gRPC API 服务。节点始终启用必需的服务;可按需启用可选服务。"
},

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Verify the presence of the new `alwaysOn` and `unknown` keys across all locale files.

for file in dashboard/public/statics/locales/*.json; do
  echo "--- $file ---"
  jq '.coreEditor.api | {title, alwaysOn, unknown}' "$file"
done

Repository: PasarGuard/panel

Length of output: 620


🏁 Script executed:

rg -n '"(alwaysOn|unknown)"|coreEditor\.api|XrayApiSection' dashboard/public/statics/locales dashboard -g '*.json' -g '*.ts' -g '*.tsx' -g '*.js' -g '*.jsx'

Repository: PasarGuard/panel

Length of output: 1712


🏁 Script executed:

python3 - <<'PY'
import json, pathlib
for name in ['en','fa','ru','zh']:
    p = pathlib.Path('dashboard/public/statics/locales/%s.json' % name)
    data = json.loads(p.read_text(encoding='utf-8'))
    api = data.get('coreEditor', {}).get('api', {})
    print(f'--- {p} ---')
    for k in ['title','hint','alwaysOn','unknown']:
        print(k, '=>', api.get(k))
PY

Repository: PasarGuard/panel

Length of output: 1025


Add the missing coreEditor.api locale keys.
XrayApiSection reads coreEditor.api.alwaysOn and coreEditor.api.unknown, and they’re missing from the non-English locale files in this PR (fa.json, ru.json, zh.json), so those users will fall back to the English defaults.

🤖 Prompt for 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.

In `@dashboard/public/statics/locales/zh.json` around lines 2196 - 2199, Add the
missing coreEditor.api.alwaysOn and coreEditor.api.unknown translation keys to
the api locale sections in fa.json, ru.json, and zh.json, using appropriate
translations consistent with each locale’s existing terminology and the English
defaults.

Comment thread dashboard/src/features/nodes/dialogs/core-config-modal.tsx Outdated
Comment thread dashboard/src/features/nodes/dialogs/core-config-modal.tsx
Comment thread dashboard/src/lib/xray-api-services.ts
Multi-Engineer-dev added a commit to multi-engineer/panel that referenced this pull request Jul 14, 2026
…ject json

api.services is Xray-only, but the submit validation ran before the backend type
was read, so a WireGuard config carrying an api.services block could be rejected
by Xray rules; the derivation memo was likewise unscoped. Both now gate on the
backend type, matching the existing isXrayBackend render gate.

handleToggleApiService also accepted any valid JSON: toggling on a non-object
config (null/array/primitive) silently replaced or mangled it on re-serialize.
Toggles now early-return unless the config is a plain object.

Addresses CodeRabbit review on PasarGuard#662.
Multi-Engineer-dev added a commit to multi-engineer/panel that referenced this pull request Jul 14, 2026
…vice

The helper resolved names via CANONICAL_API_SERVICES, which also contains the
required services, so a caller could write HandlerService into api.services --
contradicting the documented invariant that the panel never writes them (the
node injects required services itself). Restrict the lookup to the optional
set and pin the invariant with enable/disable no-op tests.

Addresses CodeRabbit review on PasarGuard#662.
Multi-Engineer-dev added a commit to multi-engineer/panel that referenced this pull request Jul 14, 2026
coreEditor.api.alwaysOn / .unknown were read by the structured editor's API
section but missing from every locale, so fa/ru/zh fell back to the inline
English defaults. The legacy modal's coreConfigModal.apiServices /
apiServiceAlwaysOn / apiServicesUnknown keys had the same gap. Add all of them
to en/fa/ru/zh (with the {{names}} interpolation preserved).

Addresses CodeRabbit review on PasarGuard#662.
Multi-Engineer-dev added a commit to multi-engineer/panel that referenced this pull request Jul 14, 2026
The test script runs node --test over .ts files, which relies on native type
stripping (default since Node 22.18/23.6) and test-runner globs; the repo only
pinned bun. Document the real constraint with an engines field.

Addresses CodeRabbit review on PasarGuard#662.
Adds an "API" section to the route-based core editor (Nodes > Cores),
mirroring the legacy core-config modal's control. Reuses the existing
xray-api-services helpers; optional services are stored on the profile's
preserved top-level `api` block and persisted through the xray adapter.
…ction

Unchecking the last optional api service emptied raw.topLevel.api, so the
adapter override disappeared and the kit re-emitted the original api from
raw.source, leaving the persisted config unchanged (Save never enabled and
the removal would not stick). setRawOptionalService now edits raw.source and
raw.topLevel in lockstep so toggles round-trip cleanly.

The API section header rendered the raw i18n key whenever a stale
(service-worker cached) locale bundle lacked the new keys. PageHeader now
accepts title/description defaults, matching the codebase's defaultValue
pattern, so the header reads correctly regardless of cache state.
The structured core editor's API section was only partly localized:
- coreEditor.section.api / sectionDesc.api existed in en.json only, so
  fa/ru/zh fell back to English for the section header.
- coreEditor.api.title / api.hint (the section card title and hint) were
  inline English defaultValues, absent from every locale file.

Add the section header keys to fa/ru/zh and the card title + hint to all
four locales (the "API" acronym is kept; descriptive text translated).
…ject json

api.services is Xray-only, but the submit validation ran before the backend type
was read, so a WireGuard config carrying an api.services block could be rejected
by Xray rules; the derivation memo was likewise unscoped. Both now gate on the
backend type, matching the existing isXrayBackend render gate.

handleToggleApiService also accepted any valid JSON: toggling on a non-object
config (null/array/primitive) silently replaced or mangled it on re-serialize.
Toggles now early-return unless the config is a plain object.

Addresses CodeRabbit review on PasarGuard#662.
…vice

The helper resolved names via CANONICAL_API_SERVICES, which also contains the
required services, so a caller could write HandlerService into api.services --
contradicting the documented invariant that the panel never writes them (the
node injects required services itself). Restrict the lookup to the optional
set and pin the invariant with enable/disable no-op tests.

Addresses CodeRabbit review on PasarGuard#662.
coreEditor.api.alwaysOn / .unknown were read by the structured editor's API
section but missing from every locale, so fa/ru/zh fell back to the inline
English defaults. The legacy modal's coreConfigModal.apiServices /
apiServiceAlwaysOn / apiServicesUnknown keys had the same gap. Add all of them
to en/fa/ru/zh (with the {{names}} interpolation preserved).

Addresses CodeRabbit review on PasarGuard#662.
The test script runs node --test over .ts files, which relies on native type
stripping (default since Node 22.18/23.6) and test-runner globs; the repo only
pinned bun. Document the real constraint with an engines field.

Addresses CodeRabbit review on PasarGuard#662.
@Multi-Engineer-dev
Multi-Engineer-dev force-pushed the feat/dashboard-xray-api-services branch from 662fd60 to 441c179 Compare July 14, 2026 22:25
@Multi-Engineer-dev

Copy link
Copy Markdown
Author

1. Unpinned Node for the test script — applied (441c179), via an engines
pin rather than switching to bun test.
Pinned node >= 22.18.0, which is
the actual floor: the script runs node --test over .ts files, relying on
native type stripping (default since 22.18/23.6) and test-runner globs. I
deliberately did NOT move to Bun's runner: the tests import node:test /
node:assert/strict, and Bun's node:test compatibility is a partial mapping
onto bun:test — keeping the Node runner and documenting the constraint is the
minimal deterministic fix.

2/3. Missing locale keys — applied (81fadea), and extended. Added
coreEditor.api.alwaysOn / .unknown to all four locales (en included, for
key-parity). While fixing it I found the same gap in the legacy modal, which
this review didn't flag: coreConfigModal.apiServices, .apiServiceAlwaysOn,
and .apiServicesUnknown were also read with inline defaults and missing from
every locale — added those too. Two wording deviations from the suggested
strings: fa uses «همیشه فعال» (matching the hint's own فعال terminology, rather
than «روشن»), and ru uses «всегда включён» (agreeing with «сервис», rather than
the impersonal «включено»).

4. Xray-only validation applied to WG configs — applied (1acea75). The
render was already gated on isXrayBackend; the submit check ran before the
backend type was even read. The unknown-services check now sits behind
backendType !== 'wg' and the derivation memo returns empty lists for WG
(dep added).

5. Non-object JSON toggle guard — applied (1acea75), with a corrected
rationale.
The review's stated failure ("passing null … throws when it
spreads the config") doesn't exist: object spread of null is legal JavaScript
({ ...null }{}), and I verified there is no throwing path anywhere in
setOptionalService. What the guard actually fixes is quieter and real:
toggling on valid-but-non-object JSON silently replaced the config (null /
primitives) or mangled it (an array becomes an index-keyed object). So the
guard is in as hardening against silent config corruption — not a crash fix,
since none existed.

6. setOptionalService accepting required services — applied (dc40d39).
Lookup is now restricted to OPTIONAL_API_SERVICES, with enable- and
disable-no-op tests pinning the invariant (same-reference return). For the
record this was unreachable from the UI (both call sites only pass optional
entries) and harmless even if reached (the node's sanitizeAPIServices dedupes
required names) — it's invariant hygiene for the exported helper.

Not addressed: the docstring-coverage pre-merge warning (35.71% < 80%).
That's a repo-wide checker default, not an actionable finding on this diff —
the dashboard codebase doesn't follow a docstring convention for TS modules,
and padding these files with comment blocks to satisfy a threshold would cut
against the existing style.

@ImMohammad20000

Copy link
Copy Markdown
Contributor

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 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 `@dashboard/public/statics/locales/zh.json`:
- Line 748: Replace the placeholder value for the "disabled" localization key
with a proper Chinese translation, such as "已禁用", so the label renders correctly
in the UI.
🪄 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: 5801404a-a439-4840-a883-45b1d7aa08f0

📥 Commits

Reviewing files that changed from the base of the PR and between e9152f2 and 441c179.

📒 Files selected for processing (15)
  • .gitignore
  • dashboard/package.json
  • dashboard/public/statics/locales/en.json
  • dashboard/public/statics/locales/fa.json
  • dashboard/public/statics/locales/ru.json
  • dashboard/public/statics/locales/zh.json
  • dashboard/src/components/layout/page-header.tsx
  • dashboard/src/features/core-editor/components/xray/xray-api-section.tsx
  • dashboard/src/features/core-editor/components/xray/xray-core-editor.tsx
  • dashboard/src/features/core-editor/kit/core-section-nav.ts
  • dashboard/src/features/core-editor/routes/core-editor-page.tsx
  • dashboard/src/features/core-editor/state/core-editor-store.ts
  • dashboard/src/features/nodes/dialogs/core-config-modal.tsx
  • dashboard/src/lib/xray-api-services.test.ts
  • dashboard/src/lib/xray-api-services.ts
🚧 Files skipped from review as they are similar to previous changes (12)
  • dashboard/src/features/core-editor/state/core-editor-store.ts
  • dashboard/src/features/core-editor/components/xray/xray-core-editor.tsx
  • dashboard/src/features/core-editor/components/xray/xray-api-section.tsx
  • dashboard/src/features/core-editor/kit/core-section-nav.ts
  • dashboard/public/statics/locales/ru.json
  • dashboard/public/statics/locales/en.json
  • dashboard/public/statics/locales/fa.json
  • dashboard/src/lib/xray-api-services.test.ts
  • .gitignore
  • dashboard/src/features/nodes/dialogs/core-config-modal.tsx
  • dashboard/src/features/core-editor/routes/core-editor-page.tsx
  • dashboard/src/lib/xray-api-services.ts

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Inline review comments failed to post. This is likely due to GitHub's internal server error or limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.

Actionable comments posted: 1

🤖 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 `@dashboard/public/statics/locales/zh.json`:
- Line 748: Replace the placeholder value for the "disabled" localization key
with a proper Chinese translation, such as "已禁用", so the label renders correctly
in the UI.
🪄 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: 5801404a-a439-4840-a883-45b1d7aa08f0

📥 Commits

Reviewing files that changed from the base of the PR and between e9152f2 and 441c179.

📒 Files selected for processing (15)
  • .gitignore
  • dashboard/package.json
  • dashboard/public/statics/locales/en.json
  • dashboard/public/statics/locales/fa.json
  • dashboard/public/statics/locales/ru.json
  • dashboard/public/statics/locales/zh.json
  • dashboard/src/components/layout/page-header.tsx
  • dashboard/src/features/core-editor/components/xray/xray-api-section.tsx
  • dashboard/src/features/core-editor/components/xray/xray-core-editor.tsx
  • dashboard/src/features/core-editor/kit/core-section-nav.ts
  • dashboard/src/features/core-editor/routes/core-editor-page.tsx
  • dashboard/src/features/core-editor/state/core-editor-store.ts
  • dashboard/src/features/nodes/dialogs/core-config-modal.tsx
  • dashboard/src/lib/xray-api-services.test.ts
  • dashboard/src/lib/xray-api-services.ts
🚧 Files skipped from review as they are similar to previous changes (12)
  • dashboard/src/features/core-editor/state/core-editor-store.ts
  • dashboard/src/features/core-editor/components/xray/xray-core-editor.tsx
  • dashboard/src/features/core-editor/components/xray/xray-api-section.tsx
  • dashboard/src/features/core-editor/kit/core-section-nav.ts
  • dashboard/public/statics/locales/ru.json
  • dashboard/public/statics/locales/en.json
  • dashboard/public/statics/locales/fa.json
  • dashboard/src/lib/xray-api-services.test.ts
  • .gitignore
  • dashboard/src/features/nodes/dialogs/core-config-modal.tsx
  • dashboard/src/features/core-editor/routes/core-editor-page.tsx
  • dashboard/src/lib/xray-api-services.ts
🛑 Comments failed to post (1)
dashboard/public/statics/locales/zh.json (1)

748-748: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Replace the placeholder disabled label.

"??" is not a usable Chinese translation and will appear directly in the UI. Use a proper value such as "已禁用".

🤖 Prompt for 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.

In `@dashboard/public/statics/locales/zh.json` at line 748, Replace the
placeholder value for the "disabled" localization key with a proper Chinese
translation, such as "已禁用", so the label renders correctly in the UI.

The key landed in PasarGuard#549 with "??"-style placeholder values in every non-English
locale (zh "??", fa "???????", ru "????????"), so the label rendered as question
marks. Fill in the proper translations, matching each locale's existing
"disabled" terminology.

Pre-existing on dev (not from this branch); surfaced by CodeRabbit's
incremental review after the rebase. Fixed here since it's a one-line-per-file
locale correction.
@Multi-Engineer-dev

Copy link
Copy Markdown
Author

Fixed in 7da7180 — with two notes.

Scope: this placeholder isn't from this branch. git blame traces
zh.json's "disabled": "??" to e012c4f (“feat(api_keys): … (#549)”) on
dev; it entered this review's window via the incremental diff across the
rebase. Fixed here anyway since it's a one-line locale correction, but flagging
the provenance so it isn't attributed to this PR's changes.

The finding was also incomplete: the same admins.disabled key carried the
same placeholder in fa ("???????") and ru ("????????") — English was the
only locale with a real value. All three are now filled in, each matching the
locale's existing “disabled” terminology elsewhere in the file: zh 已禁用,
fa غیرفعال, ru Отключен.

Validated: all four locale files parse and no ?-placeholder values remain on
the key.

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.

2 participants