Skip to content

fix(web): stabilize shared components and editor controls - #59

Merged
CSCITech merged 1 commit into
windows-test-stabilityfrom
frontend-lint-foundations
Oct 15, 2026
Merged

CSCITech merged 1 commit into
windows-test-stabilityfrom
frontend-lint-foundations

Conversation

@CSCITech

Copy link
Copy Markdown
Contributor

User information fields currently remount on unrelated parent updates, clearing text selection. Keep the existing InfoItem component at module scope and add a regression for field identity, selection, zero values and a single API request.

Separate existing verification/settings contexts and hooks, and quota-filter utilities, from component modules. Preserve the verification feature exports, gate cancellation/rejection behavior, API-token scope, method identity and settings defaults. Remove two unused lint-disable comments.

Give the pricing editor mode selector its translated accessible name and select it by role/name. Collect all optional price fields with one standard label query instead of repeated whole-DOM scans. Reuse alert-test controls and scope actions to the current confirmation dialog. Preserve every price/count/expression and financial revision/request/disabled-state assertion. Update the existing continuation-test stub to the extracted hook without changing its assertions.

Validation: 539 frontend tests pass across 34 processes; four new focused regressions, all 60 editor tests, 21 alert tests and the existing 18 continuation tests pass. User-field and missing-mode-label regressions fail on the original code. Typecheck, Prettier for all 22 changed files, ESLint for 20 files without carry-forward diagnostics, production build and both Tailwind CSS checks pass. Test mirrors contain 360 tests and two workflow files.

This is the first of three lint batches: global lint improves from 69 errors / 9 warnings to 60 errors / 1 warning, with no added diagnostics. Two changed files retain five already-recorded ref/effect errors; the global check remains failing. No rules or deadlines were relaxed. Initial runs retained editor and alert timeouts and a stale stub-path failure; the final full run passes after fixing repeated queries and updating that stub.

Compared with pinned New API 718a4e7f9751c5bf1958747cd0c2c895e2b937d4 using immutable GitHub tree/blob evidence. Its oxlint/Vitest rules differ. Implemented independently from existing MAX code; no upstream source, tooling or dependencies were transplanted, and attribution remains intact.

Stacked on windows-test-stability (PR #58); 22 changed files. Backend, financial mutations, schema, permission policy and dependency versions are unchanged. Real database/provider/browser/race coverage is not claimed.

@coderabbitai

coderabbitai Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 116c5b3b-db3d-406c-a821-eca6a04e75ff
📥 Commits

Reviewing files that changed from the base of the PR and between a2276ce and 1310e4a.

📒 Files selected for processing: 22
  • web/default/src/components/long-text.tsx
  • web/default/src/features/auth/secure-verification/components/secure-verification-provider.tsx
  • web/default/src/features/auth/secure-verification/hooks/use-api-token-verification.ts
  • web/default/src/features/auth/secure-verification/hooks/use-secure-verification-gate.ts
  • web/default/src/features/auth/secure-verification/hooks/verification-context.runtime.test.tsx
  • web/default/src/features/auth/secure-verification/index.ts
  • web/default/src/features/auth/secure-verification/lib/verification-context.ts
  • web/default/src/features/smart-ops/alerts.test.tsx
  • web/default/src/features/system-settings/components/settings-page-context.tsx
  • web/default/src/features/system-settings/components/settings-section.tsx
  • web/default/src/features/system-settings/hooks/use-suppress-settings-section-header.ts
  • web/default/src/features/system-settings/lib/settings-page-context.ts
  • web/default/src/features/system-settings/models/tiered-pricing-editor.runtime.test.tsx
  • web/default/src/features/system-settings/models/tiered-pricing-editor.tsx
  • web/default/src/features/system-settings/models/tool-price-settings.tsx
  • web/default/src/features/usage-logs/components/common-logs-filter-bar.tsx
  • web/default/src/features/usage-logs/components/dialogs/user-info-dialog.runtime.test.tsx
  • web/default/src/features/usage-logs/components/dialogs/user-info-dialog.tsx
  • web/default/src/features/usage-logs/components/quota-filter-select.tsx
  • web/default/src/features/usage-logs/components/task-logs-filter-bar.tsx
  • web/default/src/features/usage-logs/lib/quota-filter.ts
  • web/default/tests/secure-verification-continuation.test.tsx
💤 Files with no reviewable changes: 2
  • web/default/src/features/system-settings/models/tool-price-settings.tsx
  • web/default/src/components/long-text.tsx

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

📜 Recent review details
⏰ Context from checks skipped due to timeout: 1
  • GitHub Check: Backend checks
🧰 Additional context used
📚 Code guidelines: 2
CLAUDE.md — auto-discovered
AGENTS.md — auto-discovered
📓 Path-based instructions: 1
Source excerpt: Use `bun` as the preferred package manager and script runner for the frontend (`web/default/` directory):

📄 CodeRabbit inference engine (CLAUDE.md)

Files:

  • web/default/src/features/system-settings/models/tiered-pricing-editor.tsx
  • web/default/tests/secure-verification-continuation.test.tsx
  • web/default/src/features/system-settings/components/settings-section.tsx
  • web/default/src/features/auth/secure-verification/index.ts
  • web/default/src/features/auth/secure-verification/hooks/use-api-token-verification.ts
  • web/default/src/features/auth/secure-verification/hooks/use-secure-verification-gate.ts
  • web/default/src/features/auth/secure-verification/lib/verification-context.ts
  • web/default/src/features/usage-logs/components/dialogs/user-info-dialog.tsx
  • web/default/src/features/usage-logs/components/common-logs-filter-bar.tsx
  • web/default/src/features/usage-logs/components/quota-filter-select.tsx
  • web/default/src/features/system-settings/hooks/use-suppress-settings-section-header.ts
  • web/default/src/features/smart-ops/alerts.test.tsx
  • web/default/src/features/usage-logs/components/task-logs-filter-bar.tsx
  • web/default/src/features/usage-logs/lib/quota-filter.ts
  • web/default/src/features/usage-logs/components/dialogs/user-info-dialog.runtime.test.tsx
  • web/default/src/features/system-settings/components/settings-page-context.tsx
  • web/default/src/features/system-settings/lib/settings-page-context.ts
  • web/default/src/features/auth/secure-verification/components/secure-verification-provider.tsx
  • web/default/src/features/auth/secure-verification/hooks/verification-context.runtime.test.tsx
  • web/default/src/features/system-settings/models/tiered-pricing-editor.runtime.test.tsx
🔇 Additional comments: 21
web/default/src/features/usage-logs/components/dialogs/user-info-dialog.tsx: 1

41-54: LGTM!

web/default/src/features/usage-logs/components/dialogs/user-info-dialog.runtime.test.tsx: 1

143-173: LGTM!

web/default/src/features/smart-ops/alerts.test.tsx: 1

1201-1201: LGTM!

Also applies to: 1203-1225, 1234-1236, 1238-1238, 1241-1241, 1244-1246, 1248-1248, 1277-1277, 1279-1279, 1298-1301, 1306-1307, 1318-1318, 1326-1326

web/default/src/features/auth/secure-verification/lib/verification-context.ts: 1

19-30: LGTM!

web/default/src/features/auth/secure-verification/components/secure-verification-provider.tsx: 1

19-47: LGTM!

web/default/src/features/auth/secure-verification/index.ts: 1

23-24: LGTM!

web/default/src/features/auth/secure-verification/hooks/use-secure-verification-gate.ts: 1

19-33: LGTM!

web/default/src/features/auth/secure-verification/hooks/use-api-token-verification.ts: 1

21-21: LGTM!

Also applies to: 30-30, 34-34, 39-39

web/default/src/features/auth/secure-verification/hooks/verification-context.runtime.test.tsx: 1

19-184: LGTM!

web/default/tests/secure-verification-continuation.test.tsx: 1

107-107: LGTM!

web/default/src/features/system-settings/lib/settings-page-context.ts: 1

19-31: LGTM!

web/default/src/features/system-settings/components/settings-page-context.tsx: 1

29-29: LGTM!

web/default/src/features/system-settings/hooks/use-suppress-settings-section-header.ts: 1

19-24: LGTM!

web/default/src/features/system-settings/components/settings-section.tsx: 1

20-20: LGTM!

web/default/src/features/usage-logs/lib/quota-filter.ts: 1

19-25: LGTM!

web/default/src/features/usage-logs/components/quota-filter-select.tsx: 1

29-30: LGTM!

web/default/src/features/usage-logs/components/common-logs-filter-bar.tsx: 1

49-49: LGTM!

Also applies to: 59-59

web/default/src/features/usage-logs/components/task-logs-filter-bar.tsx: 1

27-27: LGTM!

Also applies to: 36-36

web/default/src/features/system-settings/models/tiered-pricing-editor.tsx: 1

288-292: LGTM!

web/default/src/features/system-settings/models/tiered-pricing-editor.runtime.test.tsx: 2

126-142: LGTM!

Also applies to: 148-150, 559-559, 561-564, 566-566, 587-589, 778-781

143-147: 🎯 Functional Correctness

The existing assert.equal(inputs.length, 2) already fails when an expected label is missing. The inner loop runs only after this assertion passes, so no additional non-empty assertion is needed.

📝 Summary

Summary by CodeRabbit

  • Accessibility
    • Added a descriptive accessible name to the tiered-pricing editor mode selector, making it easier to identify with assistive technology.
  • Tests
    • Expanded coverage for secure verification, settlement dialogs, user information dialogs, and tiered-pricing interactions, including cancellation and error scenarios.
  • Maintenance
    • Reorganized shared settings, verification, and quota-filter functionality without changing existing behavior.

The changes reorganize secure-verification and settings contexts, move quota-filter definitions into a library module, and update component markup and runtime tests across the frontend.

Changes: Secure verification

Layer / File(s) Summary
Context contract and provider wiring
web/default/src/features/auth/secure-verification/lib/verification-context.ts, web/default/src/features/auth/secure-verification/components/secure-verification-provider.tsx, web/default/src/features/auth/secure-verification/index.ts
The context contract moves into a library module. The provider imports it, and the package index exports the context and gate hook.
Gate hook and API-token integration
web/default/src/features/auth/secure-verification/hooks/use-secure-verification-gate.ts, web/default/src/features/auth/secure-verification/hooks/use-api-token-verification.ts
The gate hook reads the context and throws when no provider is present. The API-token hook imports the gate hook and calls its verification function.
Runtime verification tests
web/default/src/features/auth/secure-verification/hooks/verification-context.runtime.test.tsx, web/default/tests/secure-verification-continuation.test.tsx
Runtime tests cover provider requirements, callback identity, verification options, cancellation, return values, and rejected verification. The continuation test mocks the gate hook module.

System settings UI

Layer / File(s) Summary
Settings context and hook
web/default/src/features/system-settings/lib/settings-page-context.ts, web/default/src/features/system-settings/components/settings-page-context.tsx, web/default/src/features/system-settings/hooks/use-suppress-settings-section-header.ts, web/default/src/features/system-settings/components/settings-section.tsx
The context moves to a library module, and the header-suppression hook moves to the hooks directory. The settings section imports the hook from its new location.
Tiered-pricing editor accessibility and tests
web/default/src/features/system-settings/models/tiered-pricing-editor.tsx, web/default/src/features/system-settings/models/tiered-pricing-editor.runtime.test.tsx
The editor-mode selector receives a translated accessible name. Runtime tests locate that selector and collect labeled inputs with a helper.

Usage-log quota filters

Layer / File(s) Summary
Quota-filter contract and component imports
web/default/src/features/usage-logs/lib/quota-filter.ts, web/default/src/features/usage-logs/components/quota-filter-select.tsx, web/default/src/features/usage-logs/components/common-logs-filter-bar.tsx, web/default/src/features/usage-logs/components/task-logs-filter-bar.tsx
The quota-filter type and validator move into a library module. The select component and filter bars import them from that module.

User info dialog

Layer / File(s) Summary
Dialog rendering and runtime test
web/default/src/features/usage-logs/components/dialogs/user-info-dialog.tsx, web/default/src/features/usage-logs/components/dialogs/user-info-dialog.runtime.test.tsx
The InfoItem renderer moves out of UserInfoDialog. A runtime test checks the request, displayed fields, and selected username after rerendering.

Settlement dialog tests

Layer / File(s) Summary
Zero-quota and exact-settlement interactions
web/default/src/features/smart-ops/alerts.test.tsx
The tests retain settlement buttons across cancellation and scope confirmation controls to their dialogs. They also check disabled actions and request behavior.

Lint suppression cleanup

Layer / File(s) Summary
Suppression comment removal
web/default/src/components/long-text.tsx, web/default/src/features/system-settings/models/tool-price-settings.tsx
ESLint suppression comments are removed before state updates. The associated runtime logic is unchanged.

Priority: ⬇️ Low

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

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 1310e

The change reorganizes frontend modules and improves tests with no identified behavioral risk. It appears ready to merge after normal checks.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 15 functions across 20 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description check Passed The description accurately summarizes the changes, preserved behavior, tests, validation results, and known lint status.
Title check Passed The title clearly summarizes the primary changes to stabilize shared components and editor controls.
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.
  • Fix all pre-merge checks with AI
✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

A rabbit checks the context, then hops along the trail.
A button gets a clearer name; a filter finds its way.
Tests open dialogs, then close them with care.
The hooks find their home, and the labels stay.
I nibble one last comment, and bound away.

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

@CSCITech

Copy link
Copy Markdown
Contributor Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
✅ Action performed

Full review finished.

@CSCITech
CSCITech merged commit dc21427 into windows-test-stability Oct 15, 2026
4 checks passed
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