Skip to content

Hub login session sync and login status display in options page#400

Merged
ujiro99 merged 4 commits into
mainfrom
copilot/sync-login-session-command-hub
May 10, 2026
Merged

Hub login session sync and login status display in options page#400
ujiro99 merged 4 commits into
mainfrom
copilot/sync-login-session-command-hub

Conversation

Copilot AI commented May 10, 2026

Copy link
Copy Markdown
Contributor

Implements session synchronization between Selection Command Hub (selection-command.com) and the Chrome extension, and surfaces the login state in the options page.

Changes

External message handlers (hub/background.ts)

  • SetSession: stores { name, image } user data to LOCAL_STORAGE_KEY.HUB_USER when Hub sends login event; validates both fields are strings before writing
  • ClearSession: nulls out HUB_USER on logout
// Hub site sends to extension:
chrome.runtime.sendMessage(extensionId, { action: "SetSession", session: { name, image } })
chrome.runtime.sendMessage(extensionId, { action: "ClearSession" })

Storage (storage/const.ts, storage/index.ts)

  • Added LOCAL_STORAGE_KEY.HUB_USER — uses chrome.storage.local for cross-session persistence

Type (types/index.ts)

  • Added HubUser = { name: string; image: string }

Options page UI (HubBanner.tsx, HubBanner.module.css)

  • Logged in → avatar + display name (image load errors handled gracefully with onError hide)
  • Logged out → login link pointing to NEW_HUB_URL/auth/signin
  • Reacts to storage changes via Storage.addListener for real-time sync

i18n

  • Added hub_login key to all 14 supported locales

Copilot AI changed the title [WIP] Synchronize login sessions for Selection Command Hub Hub login session sync and login status display in options page May 10, 2026
Copilot AI requested a review from ujiro99 May 10, 2026 09:38
@ujiro99 ujiro99 marked this pull request as ready for review May 10, 2026 13:24
@codecov

codecov Bot commented May 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 53.65854% with 57 lines in your changes missing coverage. Please review.
✅ Project coverage is 27.19%. Comparing base (0855084) to head (907dc59).

Files with missing lines Patch % Lines
...es/extension/src/components/option/HubUserInfo.tsx 0.00% 42 Missing ⚠️
packages/extension/src/services/hub/background.ts 87.67% 9 Missing ⚠️
...ackages/extension/src/components/option/Option.tsx 0.00% 4 Missing ⚠️
...ages/extension/src/components/option/HubBanner.tsx 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #400      +/-   ##
==========================================
+ Coverage   27.09%   27.19%   +0.10%     
==========================================
  Files         315      316       +1     
  Lines       31780    31899     +119     
  Branches     1718     1732      +14     
==========================================
+ Hits         8611     8676      +65     
- Misses      23169    23223      +54     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ujiro99 ujiro99 merged commit 45e36b9 into main May 10, 2026
5 of 6 checks passed
@ujiro99 ujiro99 deleted the copilot/sync-login-session-command-hub branch May 10, 2026 13:26
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.

Selection Command Hubのログインセッションの同期

2 participants