Skip to content

refactor: DRY sweep across settings, messaging... - #93

Merged
junaidkbr merged 38 commits into
mainfrom
refactor/simplify-sweep
Aug 10, 2026
Merged

junaidkbr merged 38 commits into
mainfrom
refactor/simplify-sweep

Conversation

@junaidkbr

@junaidkbr junaidkbr commented Aug 9, 2026 •

Copy link
Copy Markdown
Member

A DRY/simplify sweep across the extension. Roughly 95% of the diff is dedupe and
deletion; four user-visible fixes came out of it along the way.

No version bump and no changelog entry — the sweep isn't a release. The four
fixes below ride along and get changelogged whenever the next release ships.

What got centralized

Four cross-cutting concerns each collapsed from many copies into one path:

Concern Before After
Settings defaults + deep-merge duplicated in the options store and read ad-hoc elsewhere utils/settings.ts owns defaults, merge, isEnabled, read/write/watch
Messaging untyped { action, ... } objects, two background listeners utils/messages.ts typed contract, one background router
Main-world RPC hand-rolled postMessage plumbing in the cart and theme relays utils/mainWorldBridge.ts typed client/server
Popup tabs tab list, TabId union, and PopupSection maintained separately entrypoints/popup/tabs.ts single registry

Plus: shared CSV/download helpers (utils/export.ts), Supabase VALID_ACTIONS
generated from the client list instead of hand-mirrored, and a pile of dead code
deleted (formatTimeAgo, unused contextMenu CRUD, commented-out Theme tab markup).

Net: -2589 / +1945 across 88 files.

User-visible fixes found during the sweep

  • Theme Inspector setting never showed the saved selection — the choice list
    always rendered as if set to default (9f30d6a)
  • Popup paints before the theme relay resolves — first paint on Shopify stores
    no longer waits on a main-world round trip; the theme card fills in after
    (eaedaa4)
  • App age used wall-clock math — an app launched 2025-08-20 read "1 year" on
    2026-08-09 instead of "11 months". Both formatters now share calendar
    arithmetic (1cd043f, fe1a9c9)
  • Partner CSV export had no formula-injection guard — it quote-escaped but
    never neutralized leading =/+/-/@. Now every field goes through
    csvField

Also hardened: the background message router now rejects messages whose
sender.id isn't this extension (previously only the link-status listener
checked), and the main-world theme response posts to window.location.origin
instead of '*'.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1dbc123607

ℹ️ 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".

Comment thread entrypoints/options/stores/settings.svelte.ts
@junaidkbr junaidkbr changed the title refactor: DRY sweep across settings, messaging, and main-world bridge refactor: DRY sweep across settings, messaging... Aug 9, 2026

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fabec68886

ℹ️ 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".

Comment thread entrypoints/dev-dashboard.content.ts

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bc9021c740

ℹ️ 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".

Comment thread utils/restore-right-click.ts Outdated
Comment thread entrypoints/shopify-admin.content/timeline.logic.ts
Comment thread utils/appListing.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e632aa1a3d

ℹ️ 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".

Comment thread entrypoints/popup/App.svelte Outdated
Comment thread entrypoints/popup/utils/robots.ts Outdated
@junaidkbr
junaidkbr merged commit 1ac7207 into main Aug 10, 2026
1 check passed
@junaidkbr
junaidkbr deleted the refactor/simplify-sweep branch August 31, 2026 22:47
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