Feat: Add toggle switch to enable/disable accounts from main screen#728
Feat: Add toggle switch to enable/disable accounts from main screen#728
Conversation
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>
|
@dadarara feel free to try this branch and tell me if it works for you. |
There was a problem hiding this comment.
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/toggleExporterActiveactions toConfigStore. - 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>
| <Form.Check | ||
| className={styles.activeToggle} | ||
| type="switch" | ||
| checked={account.active} | ||
| onChange={onToggleActive} | ||
| title={account.active ? 'פעיל' : 'לא פעיל'} | ||
| aria-label={account.active ? 'פעיל' : 'לא פעיל'} |
There was a problem hiding this comment.
@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?
|
@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>
there is no window exe artifact. I am not very experienced in git. so dont know how to build and have the exe generated. :) |
Summary
Closes #713
🤖 Generated with Claude Code