fix(ui): avoid toSorted in cron suggestions#31775
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1450bd9da3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Greptile SummaryThis PR attempts to fix browser compatibility issues by replacing Key changes:
Critical issue:
Confidence Score: 1/5
Last reviewed commit: 91af29e |
|
Addressed. Validation run:
|
|
Follow-up pushed in commit 024b3ff to ensure the helper itself no longer uses Current implementation:
|
72ec607 to
8145c66
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8145c66e79
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Addressed the review items on this branch:
Current CI is still blocked by an existing unrelated Bun lane test failure in |
816d1ae to
c72b855
Compare
|
Implemented both remaining review items on the canonical branch:
This also resolves the earlier performance comment in the helper path. Current head commit: There are still 2 unresolved review threads in the PR UI (legacy bot comments), but they are now addressed by this commit; please mark those as resolved if you want. |
|
Updated
Latest commit on this branch: |
|
@greptileai review |
ea44306 to
1c87cdb
Compare
|
Addressed the format check failure in The only changed file is:
Checks should re-run now from this head. |
|
I fixed the remaining oxfmt check issue by formatting with the repo's pinned formatter version:
Please re-run the CI check; it should clear the format failure if this head is being evaluated. |
Additional Comments (1)
also need to import |
* Control UI: avoid toSorted in cron suggestions * Control UI: make sortLocaleStrings legacy-safe * fix(ui): use sort fallback in locale string helper * fix(ui): remove toSorted from locale helper * fix(ui): remove toSorted from locale helper * fix(ui): remove toSorted from locale helper * fix(ui): remove toSorted from locale helper * fix(ui): remove toSorted from locale helper * fix(ui): avoid sort in locale helper for browser compatibility * ui: avoid unnecessary assertions in locale sort * changelog: credit browser-compat cron fix PR * fix(ui): use native locale sort in compatibility helper * ui: use compat merge-sort for locale strings * style: format locale sort helper * style: fix oxfmt ordering in agents utils --------- Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
* Control UI: avoid toSorted in cron suggestions * Control UI: make sortLocaleStrings legacy-safe * fix(ui): use sort fallback in locale string helper * fix(ui): remove toSorted from locale helper * fix(ui): remove toSorted from locale helper * fix(ui): remove toSorted from locale helper * fix(ui): remove toSorted from locale helper * fix(ui): remove toSorted from locale helper * fix(ui): avoid sort in locale helper for browser compatibility * ui: avoid unnecessary assertions in locale sort * changelog: credit browser-compat cron fix PR * fix(ui): use native locale sort in compatibility helper * ui: use compat merge-sort for locale strings * style: format locale sort helper * style: fix oxfmt ordering in agents utils --------- Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
* Control UI: avoid toSorted in cron suggestions * Control UI: make sortLocaleStrings legacy-safe * fix(ui): use sort fallback in locale string helper * fix(ui): remove toSorted from locale helper * fix(ui): remove toSorted from locale helper * fix(ui): remove toSorted from locale helper * fix(ui): remove toSorted from locale helper * fix(ui): remove toSorted from locale helper * fix(ui): avoid sort in locale helper for browser compatibility * ui: avoid unnecessary assertions in locale sort * changelog: credit browser-compat cron fix PR * fix(ui): use native locale sort in compatibility helper * ui: use compat merge-sort for locale strings * style: format locale sort helper * style: fix oxfmt ordering in agents utils --------- Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
Summary
Describe the problem and fix in 2–5 bullets:
Array.prototype.toSortedwhile computing cron suggestion lists inapp-render.toSortedthrow a runtimeTypeError, causing Control UI to white-screen.toSortedusage in cron suggestion rendering with a shared compatibility sorter (sortLocaleStrings) and added regression coverage.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
User-visible / Behavior Changes
Array.prototype.toSorted.Security Impact (required)
No)No)No)No)No)Yes, explain risk + mitigation:Repro + Verification
Environment
gateway.controlUi.enabled: trueSteps
toSorted.Expected
Actual
Array.from(...).sort(...), avoidingtoSortedruntime dependency.Evidence
Attach at least one:
Passing tests/checks run locally:
pnpm test ui/src/ui/views/agents-utils.test.tspnpm exec oxfmt --check ui/src/ui/app-render.ts ui/src/ui/views/agents-utils.ts ui/src/ui/views/agents-utils.test.ts CHANGELOG.mdNote on repo baseline:
pnpm checkfails on pre-existing unrelated TypeScript errors insrc/process/exec.windows.test.ts.Human Verification (required)
What you personally verified (not just CI), and how:
app-renderuses compatibility helper.resolveConfiguredCronModelSuggestionsbehavior remains sorted.Set,string[]).Compatibility / Migration
Yes)No)No)Failure Recovery (if this breaks)
ui/src/ui/app-render.tsui/src/ui/views/agents-utils.tsRisks and Mitigations
List only real risks for this PR. Add/remove entries as needed. If none, write
None.localeComparecomparator and regression tests cover expected ordering.