Repository navigation
Refactor toast settings to expose only an application-facing runtime API - #1470
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-authored-by: marcuscastelo <27441558+marcuscastelo@users.noreply.github.com> Agent-Logs-Url: https://github.com/marcuscastelo/macroflows/sessions/1bb80835-9ffd-40bd-b872-1bbad478e7b9
Co-authored-by: marcuscastelo <27441558+marcuscastelo@users.noreply.github.com> Agent-Logs-Url: https://github.com/marcuscastelo/macroflows/sessions/1bb80835-9ffd-40bd-b872-1bbad478e7b9
Co-authored-by: marcuscastelo <27441558+marcuscastelo@users.noreply.github.com> Agent-Logs-Url: https://github.com/marcuscastelo/macroflows/sessions/1bb80835-9ffd-40bd-b872-1bbad478e7b9
There was a problem hiding this comment.
Pull request overview
Refactors the toast settings module to better enforce layering: infrastructure now exposes only a store factory, while the application layer provides the default runtime API consumed by UI and tests.
Changes:
- Changed
toastSettingsinfrastructure module to export onlycreateToastSettingsStore()(moving get/update/reset inside the factory). - Added an application-layer runtime wrapper (
getToastSettings,updateToastSettings,resetToastSettings) backed by a single default store instance. - Updated the settings UI and tests to consume the application-facing API and adjusted test coverage accordingly.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/sections/settings/components/ToastSettings.tsx | Retargets UI imports to the application-layer toast settings runtime API. |
| src/modules/toast/tests/toastSettings.test.ts | Updates tests to use the application API and adds a factory-boundary isolation test. |
| src/modules/toast/infrastructure/toastSettings.ts | Encapsulates settings operations inside a factory and removes infra-level helper exports. |
| src/modules/toast/application/toastSettings.ts | Adds the public runtime entrypoint that owns the default store instance. |
|
Encontrei uma lacuna no boundary final: ainda exporta ToastSettings not found. Pelo contrato desta issue, esse arquivo deveria expor só a factory () e manter os demais detalhes fora da infraestrutura. Sugestão: mover para um arquivo de tipo/domínio compartilhado ou para a camada de application e fazer exportar apenas a factory. Hoje o runtime ficou bem encapsulado, mas o type export ainda deixa a infraestrutura com API pública além da factory. |
|
Encontrei uma lacuna no boundary final: o arquivo src/modules/toast/infrastructure/toastSettings.ts ainda exporta o tipo ToastSettings. Pelo contrato desta issue, esse arquivo deveria expor so a factory createToastSettingsStore e manter os demais detalhes fora da infrastructure. Sugestao: mover ToastSettings para um arquivo de tipo compartilhado ou para a camada de application, deixando toastSettings.ts com apenas a factory como API publica. O runtime ficou bem encapsulado; o ponto que falta e so remover esse type export da infrastructure. |
The toast settings module was leaking infrastructure-level runtime helpers directly to consumers. This change narrows the boundary so infrastructure exports only a factory, while the application layer owns the default runtime API used by the UI and tests.
Infrastructure boundary
src/modules/toast/infrastructure/toastSettings.tsto export onlycreateToastSettingsStore().get/update/resetoperations inside the factory so they are no longer infrastructure exports.Application runtime wrapper
src/modules/toast/application/toastSettings.tsas the public runtime entrypoint.getToastSettings()updateToastSettings()resetToastSettings()Consumer updates
Test coverage adjustment
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
test.supabase.co/opt/hostedtoolcache/node/24.14.0/x64/bin/node /opt/hostedtoolcache/node/24.14.0/x64/bin/node --conditions node --conditions development /home/REDACTED/work/macroflows/macroflows/node_modules/.pnpm/tinypool@1.1.1/node_modules/tinypool/dist/entry/process.js(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.