Skip to content

Remove unused shareStatus state from Header component#24

Merged
AccessiT3ch merged 2 commits intofeature/phase1.4-web-api-error-handlingfrom
copilot/sub-pr-20-again
Feb 1, 2026
Merged

Remove unused shareStatus state from Header component#24
AccessiT3ch merged 2 commits intofeature/phase1.4-web-api-error-handlingfrom
copilot/sub-pr-20-again

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 1, 2026

Addresses feedback that shareStatus state in Header.jsx was defined but never rendered in the UI, unlike the Share component which displays status inline.

Changes

  • Removed unused state management: Deleted shareStatus state, shareTimeoutRef ref, and cleanup effect
  • Simplified share handler: Share button now only invokes shareHandler with alert callbacks, no state tracking

The Header component intentionally uses alerts for feedback (original UX pattern), while Share.jsx displays status inline. Setting unreferenced state was wasteful.

Before:

const [shareStatus, setShareStatus] = useState({ type: null, message: "" });
// ... 40+ lines of state management that never rendered

After:

onClick={async () => {
  await shareHandler({
    shareUrl: window.location.href,
    shareTitle: document.title,
    onSuccess: (message) => {
      if (message.includes("clipboard")) alert(message);
    },
    onError: (message) => {
      alert(message.includes("Permission denied") ? message : `Share failed: ${message}`);
    },
  });
}}

Header with Share button


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: AccessiT3ch <95449364+AccessiT3ch@users.noreply.github.com>
@AccessiT3ch AccessiT3ch marked this pull request as ready for review February 1, 2026 08:28
Copilot AI changed the title [WIP] Update comprehensive error handling for web APIs Remove unused shareStatus state from Header component Feb 1, 2026
Copilot AI requested a review from AccessiT3ch February 1, 2026 08:29
@AccessiT3ch AccessiT3ch merged commit 0393ee8 into feature/phase1.4-web-api-error-handling Feb 1, 2026
1 check passed
@AccessiT3ch AccessiT3ch deleted the copilot/sub-pr-20-again branch February 1, 2026 08:29
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.

2 participants