Skip to content

[codex] Extract settings runtime wiring#1045

Merged
elkimek merged 4 commits into
mainfrom
codex/extract-settings-runtime-wiring
Jul 5, 2026
Merged

[codex] Extract settings runtime wiring#1045
elkimek merged 4 commits into
mainfrom
codex/extract-settings-runtime-wiring

Conversation

@elkimek

@elkimek elkimek commented Jul 5, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add js/settings-runtime.js as the browser-runtime adapter for Settings/Tweaks global hooks.
  • Route Settings RAF, media query, theme event, chart refresh, Sun data-source config, and global publication through the adapter.
  • Precache/typecheck the new module, bump version.js, and tighten the window coupling guardrail to the current measured count.
  • Update source guards and security coverage so settings.js stays free of direct window. references.

Validation

  • npm run typecheck
  • npm run typecheck:checkjs
  • npm run quality
  • node tests/test-settings-delegated-actions.js
  • node tests/test-modal-lifecycle-integrations.js
  • node tests/test-crypto.js
  • node tests/test-light-page-view-delegated-actions.js
  • node tests/test-profile-share.js
  • node tests/test-unit-import.js
  • npx playwright test tests/playwright/settings-browser-coverage.spec.js --workers=1
  • ./run-tests.sh

@vercel

vercel Bot commented Jul 5, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
get-based Error Error Jul 5, 2026 11:04am

@greptile-apps

greptile-apps Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR moves Settings browser wiring into a runtime adapter. The main changes are:

  • New js/settings-runtime.js adapter for browser globals and meteo config hooks.
  • Settings now delegates RAF, media-query, theme, chart, and global publication calls.
  • Sun data-source save paths now warn when the runtime save is unavailable or throws.
  • The new module is added to precache, typecheck, and test coverage.

Confidence Score: 5/5

This looks safe to merge.

No blocking issues found in the changed code, and the Sun data-source save paths now surface unavailable or throwing saves through the same warning flow.

No files need attention.

T-Rex T-Rex Logs

What T-Rex did

  • Ran the base settings-runtime contract and confirmed the run completed with exit code 0 and 12 passed, 0 failed.
  • Executed the head settings-runtime sequence; three commands completed with exit code 0, and adapter activity was observed for RAF, cancel RAF, matchMedia, event listeners, surface refreshes, chart theme refresh, meteo get/save, and global publication.
  • Compared before and after artifacts to verify the presence of settings-runtime in APP_SHELL and improved coverage; observed version bump from 1.10.66 to 1.10.70, windowReferences dropped from 1088 to 613, and direct window references in js/settings.js fell from 23 to 0, with all head guardrail/runtime tests passing (quality guardrails 22/22, modal lifecycle 31/31, settings delegated actions 57/57, and settings runtime 6/6).

View all artifacts

T-Rex Ran code and verified through T-Rex

Important Files Changed

Filename Overview
js/settings-runtime.js Adds the Settings runtime adapter and converts missing or thrown meteo saves into a false return for callers.
js/settings.js Routes Settings runtime calls through the adapter and shows a warning when Sun data-source saves cannot be persisted.
service-worker.js Adds the new Settings runtime module to the app shell cache.
tests/test-settings-runtime.js Adds coverage for missing, delegated, and throwing meteo runtime behavior.

Reviews (4): Last reviewed commit: "Handle thrown meteo settings saves" | Re-trigger Greptile

Comment thread js/settings.js Outdated
Comment thread js/settings.js Outdated
Comment thread js/settings-runtime.js Outdated
@elkimek elkimek merged commit c5341a7 into main Jul 5, 2026
5 of 6 checks passed
@elkimek elkimek deleted the codex/extract-settings-runtime-wiring branch July 5, 2026 11:12
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