[codex] Extract provider model controls#453
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Greptile SummaryThis PR extracts the provider model dropdown and pricing handler functions from
Confidence Score: 4/5Safe to merge — this is a straightforward code extraction with no behavioral changes. The refactor cleanly moves model dropdown and pricing functions to a dedicated module. All window-facing function registrations remain intact in provider-panels.js's Object.assign block, re-exported functions behave identically to the originals, and the new module is correctly added to the service worker cache with a version bump. The one minor deviation from the CLAUDE.md convention is that provider-model-controls.js does not carry its own Object.assign(window, ...) block — window exposure is delegated entirely to provider-panels.js, which works correctly here but is a slight inconsistency with how other modules in this codebase self-register their window-facing handlers. js/provider-model-controls.js — new file worth a quick scan to confirm no window registration is needed independently if provider-panels.js ever stops acting as the re-export barrel. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[provider-panels.js] -->|imports & re-exports| B[provider-model-controls.js]
B -->|imports| C[api.js\nget/setVeniceModel\nget/setOpenRouterModel\nget/setRoutstrModel\nget/setPpqModel\nget/setCustomApiModel\nrenderModelPricingHint\nfetchOpenRouterModelPricing\ngetVeniceE2EE / setVeniceE2EE]
B -->|imports| D[provider-panel-renderers.js\nbuildModelOptions]
B -->|imports| E[utils.js\nescapeHTML\nshowNotification]
A -->|Object.assign window| F[window\nonVeniceModelDropdownChange\ntoggleVeniceE2EE\nupdateVeniceModelPricing\nonOpenRouterDropdownChange\napplyCustomOpenRouterModel\nupdateOpenRouterModelPricing\nupdateRoutstrModelPricing\nupdatePpqModelPricing\nupdateCustomModelPricing\napplyCustomApiManualModel\nrenderCustomApiModelDropdown\n...]
G[service-worker.js\nAPP_SHELL] -->|caches| B
G -->|caches| A
H[HTML inline handlers\nonchange / onkeydown] -->|calls via window| F
Reviews (1): Last reviewed commit: "Extract provider model controls" | Re-trigger Greptile |
Summary
provider-model-controls.js.provider-panels.jsfocused on provider key, balance, wallet, and local model advisor flows while re-exporting existing window-facing helpers.1.8.279.Validation
node tests/test-openrouter.jsnode tests/test-custom-api.jsnode tests/test-venice-e2ee.jsnode tests/test-audit.jsnode tests/test-cashu-wallet.js./run-tests.sh