Skip to content

Feat: Add toggle switch to enable/disable accounts from main screen#728

Open
brafdlog wants to merge 3 commits intomasterfrom
feature/account-toggle-checkboxes
Open

Feat: Add toggle switch to enable/disable accounts from main screen#728
brafdlog wants to merge 3 commits intomasterfrom
feature/account-toggle-checkboxes

Conversation

@brafdlog
Copy link
Owner

@brafdlog brafdlog commented Feb 7, 2026

Summary

  • Adds a hover-visible toggle switch to each importer and exporter card on the main screen
  • Users can quickly include/exclude accounts from scraping without opening the settings dialog
  • Toggle is hidden during scraping, matching the behavior of other action buttons
  • Widened account cards (200px → 260px) and container (260px → 300px) to accommodate the new toggle

Closes #713

🤖 Generated with Claude Code

Add a hover-visible toggle switch to each importer and exporter card,
allowing users to quickly include/exclude accounts from scraping without
opening the settings dialog. Toggle is hidden during scraping.

Closes #713

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@brafdlog
Copy link
Owner Author

brafdlog commented Feb 7, 2026

@dadarara feel free to try this branch and tell me if it works for you.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an inline enable/disable control for importer/exporter accounts on the main screen, allowing users to include/exclude accounts from scraping without opening settings (per #713), and adjusts card/container sizing to fit the new control.

Changes:

  • Added toggleImporterActive / toggleExporterActive actions to ConfigStore.
  • Added a hover-visible switch control on account cards (disabled/hidden while scraping).
  • Updated account card and container widths to accommodate the switch.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/renderer/src/store/ConfigStore.tsx Adds store actions to toggle importer/exporter active state in config.
packages/renderer/src/components/exporters/Exporters.tsx Wires exporter cards to the new toggle action (when not scraping).
packages/renderer/src/components/accounts/Importers.tsx Wires importer cards to the new toggle action (when not scraping).
packages/renderer/src/components/accounts/Account.tsx Renders a Form.Check switch on cards when onToggleActive is provided.
packages/renderer/src/components/accounts/Account.module.css Adds hover-only visibility styling for the new switch and widens the card.
packages/renderer/src/components/accounts/NewAccount.module.css Widens the “new account” card to match the updated account card width.
packages/renderer/src/components/accounts/AccountsContainer.module.css Widens the container to fit the widened cards.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

- Add aria-label to toggle switch for screen reader accessibility
- Narrow Exporter.companyId to OutputVendorName to eliminate type cast

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Comment on lines 54 to 60
<Form.Check
className={styles.activeToggle}
type="switch"
checked={account.active}
onChange={onToggleActive}
title={account.active ? 'פעיל' : 'לא פעיל'}
aria-label={account.active ? 'פעיל' : 'לא פעיל'}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot I see the onToggleActive passed as prop with !isScraping ? () => configStore.toggleImporterActive(account.id) : undefined.

This is strange, Maybe we should add a prop for enable/disable the toggle?

Copy link
Contributor

Copilot AI commented Feb 8, 2026

@baruchiro I've opened a new pull request, #729, to work on those changes. Once the pull request is ready, I'll request review from you.

…nent (#729)

Refactor the Account component to use an explicit `disabled` prop
instead of conditionally passing `onToggleActive` based on scraping
state.

**Before:**
```tsx
<Account
  onToggleActive={!isScraping ? () => configStore.toggleImporterActive(account.id) : undefined}
/>
```

**After:**
```tsx
<Account
  onToggleActive={() => configStore.toggleImporterActive(account.id)}
  disabled={isScraping}
/>
```

**Changes:**
- Add `disabled?: boolean` prop to `AccountProps` interface
- Pass `disabled` prop to `Form.Check` toggle switch component
- Update `Importers.tsx` and `Exporters.tsx` to use the new prop pattern

<!-- START COPILOT CODING AGENT TIPS -->
---

✨ Let Copilot coding agent [set things up for
you](https://github.com/brafdlog/caspion/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot)
— coding agent works faster and does higher quality work when set up for
your repo.

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: baruchiro <17686879+baruchiro@users.noreply.github.com>
@dadarara
Copy link

dadarara commented Feb 9, 2026

@dadarara feel free to try this branch and tell me if it works for you.

there is no window exe artifact. I am not very experienced in git. so dont know how to build and have the exe generated. :)

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.

individually chose accounts for processing using a checkbox

4 participants