Skip to content

v2026.09.24 feat(admin): retire sidebar toggle, add farewell toast - #96

Merged
junaidkbr merged 6 commits into
mainfrom
chore/retire-admin-sidebar-toggle
Sep 24, 2026
Merged

junaidkbr merged 6 commits into
mainfrom
chore/retire-admin-sidebar-toggle

Conversation

@junaidkbr

Copy link
Copy Markdown
Member

Summary

Shopify's new admin dashboard ships a built-in sidebar toggle (⌘B), so Alfred's collapse toggle is retired, with a one-time goodbye for merchants who used it.

Sidebar toggle retirement

  • Removed ToggleSidebar.ts, the collapsibleSidebar option (types, defaults, options page), and the README feature line.
  • Removed the toggle_admin_sidebar analytics action and regenerated valid-actions.gen.ts.

One-time goodbye toast

  • Merchants who still have the toggle's admin-sidebar-state storage key see a persistent announcement once. The key is cleared right away.
  • The check runs at the end of the admin content script, so it never delays the code editor close warning.
  • Added removeItem to utils/storage.ts.

Toast announcement variant

  • New 'announcement' variant for Toast.show: larger, centered, up to 800px wide. Only this variant turns <br> into line breaks; every other toast keeps plain textContent, exactly as before.

Docs

  • CLAUDE.md notes that /version-bump runs inside /ship, and documents the linkedom DOM test convention.
  • CONTRIBUTING.md testing guide synced with the tests/ layout and bun run track:gen.
  • TODOS.md has a P3 item to retire the goodbye toast once most toggle users have seen it.

Deploy note: run deploy:track only after most users have updated. The regenerated allowlist drops toggle_admin_sidebar events from older clients.

Test Coverage

CODE PATHS
utils/toast.ts
├── Toast.show(message, type, duration, variant = 'default')
│   ├── [★★★ TESTED] no existing toast → create(..., variant)
│   └── [★★  TESTED] existing toast → hide it, create(..., variant) +100ms
├── Toast.create(...)
│   ├── [★★★ TESTED] 'announcement' → host class alfred-toast--announcement
│   ├── [★★  TESTED] 'default' → no announcement class
│   ├── [★★★ TESTED] default toasts keep <br> and other markup as literal text
│   ├── [★★★ TESTED] announcement: <br> → real <br>, other markup literal
│   └── [★★  TESTED] announcement: <br/> and <BR /> forms
└── [→E2E] announcement CSS (max-content width, 800px cap, centered text)

entrypoints/shopify-admin.content/index.ts main()
├── [★★★ TESTED] legacy key set → removeItem + Toast.show(msg, 'success', 0, 'announcement')
├── [★★★ TESTED] second run → silent (one-time)
├── [★★  TESTED] key absent → silent
└── [★★★ TESTED] key cleanup rejects → code editor warning still armed, no toast

Removals (ToggleSidebar.ts, collapsibleSidebar, toggle_admin_sidebar)
└── [★★★ TESTED] ANALYTICS_ACTIONS ↔ valid-actions.gen.ts parity (existing)

USER FLOWS
├── [★★★ TESTED] toggle user opens admin → farewell once (logic); visuals + dismiss [→E2E]
├── [★★  TESTED] merchant who never used toggle → no toast
├── [→E2E] Options > Admin lists 3 toggles, no 'Collapsible sidebar'
└── [→E2E] two admin tabs load together → farewell may show twice (accepted)

Tests: 27 → 29 files (+2 new). Coverage gate: 75%, remaining paths intentionally uncovered (visual/E2E only).

Pre-Landing Review

Two review cycles, 5 specialists each (testing, maintainability, security, performance, simplification) plus Red Team in cycle 1.

  • [AUTO-FIXED] Farewell awaited storage before the code editor close warning was armed → moved to end of main(), test added.
  • [FIXED] <br> parsing applied to all toasts, letting URL-sourced text add line breaks → limited to the announcement variant.
  • [AUTO-FIXED] Content script bypassed the ~/utils/storage wrapper → added removeItem, dropped the process-wide #imports test mock.
  • [AUTO-FIXED] Stale test comment and past-tense key comment rewritten.
  • [AUTO-FIXED] Rejection test now asserts no toast and key retained; shared storage mock gained removeItem.
  • Accepted as is: farewell may show twice across two tabs; farewell can be lost if replaced or the first load is abandoned; toggle users who disabled the option still see the goodbye.

Review did not fully converge: the cycle 2 Red Team was stopped to wrap up, and cycle 2 fixes were test-only.

Design Review

Design Review (lite): 0 findings. AI Slop: clean. Detector: not installed. Codex design pass: no visual findings.

Eval Results

No prompt-related files changed. Evals skipped.

Scope Drift

Scope Check: CLEAN

Plan Completion

No plan file detected.

Verification Results

Skipped: no plan file. The toast was previewed manually in the WXT dev browser on the Shopify admin.

TODOS

No TODO items completed in this PR. Added: "Retire the one-time sidebar toggle goodbye toast" (P3).

Documentation

  • CONTRIBUTING.md: Testing section now matches the repo: tests live in tests/ subfolders (example path fixed to entrypoints/popup/tests/robots.test.ts), analytics events are synced by running bun run track:gen to regenerate supabase/functions/track/valid-actions.gen.ts rather than hand-editing index.ts, and DOM tests use linkedom.
  • CLAUDE.md: Testing section documents the linkedom convention for DOM tests (set globals before importing the module under test, restore them in afterAll).
  • README.md: already current; the Admin Sidebar Collapse feature line was removed with the feature.

Test plan

  • bun test: 702 pass, 0 fail
  • bun run typecheck: clean
  • bun run lint: clean
  • bun run check (svelte-check): 0 errors
  • bun run build: succeeded

Shopify's new admin ships a built-in sidebar toggle (⌘B), so Alfred's
toggle, its collapsibleSidebar setting, and the toggle_admin_sidebar
analytics action are removed.

- Show a one-time farewell toast to merchants who used the toggle
- Add an 'announcement' toast variant (larger, centered, <br> line
  breaks); other toasts keep plain text
- Add removeItem to utils/storage

Run deploy:track only after most users update: the regenerated
allowlist drops toggle events from older clients.
Add TODO to retire the one-time farewell toast.
CONTRIBUTING pointed at co-located tests and a hand-edited VALID_ACTIONS
list, but tests live in tests/ subfolders and the list is generated by
bun run track:gen. Also document linkedom for DOM tests.
- wxt 0.21 no longer bundles vite and web-ext; add both as dev deps
- oxfmt 0.70 reflows two files
- typescript stays on 6: svelte-check peer range caps at ^6
CI reads the version from packageManager instead of tracking latest,
so local and CI stay on the same bun.
@junaidkbr
junaidkbr merged commit 0cf4fa8 into main Sep 24, 2026
2 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