Repository navigation
Refactor template-search tab preference infra to export only a factory - #1467
Merged
marcuscastelo merged 3 commits intoMar 24, 2026
Merged
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/b0157939-1dbd-407a-a1eb-2363c82780bc
Co-authored-by: marcuscastelo <27441558+marcuscastelo@users.noreply.github.com> Agent-Logs-Url: https://github.com/marcuscastelo/macroflows/sessions/b0157939-1dbd-407a-a1eb-2363c82780bc
Copilot
AI
changed the title
[WIP] Refactor template-search module to encapsulate infra exports
Refactor template-search tab preference infra to export only a factory
Mar 24, 2026
marcuscastelo
marked this pull request as ready for review
March 24, 2026 20:52
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors the template-search tab preference persistence infrastructure to encapsulate localStorage details behind a single exported factory, updating the UI consumer and tests to interact only through that public API.
Changes:
- Replaced direct exports (
loadTabPreference,saveTabPreference,DEFAULT_TAB) with a singlecreateTemplateSearchTabPreference()factory. - Updated
TemplateSearchModalto use a factory-created adapter instance for loading/saving the selected tab. - Updated infrastructure tests to validate behavior only via the exported factory.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/sections/search/components/TemplateSearchModal.tsx | Switches from direct helper imports to a factory-created preference adapter instance. |
| src/modules/template-search/infrastructure/templateSearchTabPreference.ts | Makes persistence helpers file-local and exposes only createTemplateSearchTabPreference() as the public API. |
| src/modules/template-search/infrastructure/tests/templateSearchTabPreference.test.ts | Refactors tests to exercise persistence behavior exclusively via the factory-created adapter. |
marcuscastelo
deleted the
copilot/marcuscastelo-encapsulate-infra-exports
branch
March 24, 2026 21:15
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
template-searchinfrastructure was exposing its localStorage implementation details directly. This refactor narrows the public surface to a single factory and updates consumers to depend on the adapter shape instead of file-level helpers.Infrastructure encapsulation
templateSearchTabPreference.tswith a singlecreateTemplateSearchTabPreference()factory.DEFAULT_TAB, validation, and localStorage load/save helpers file-local.Call-site update
TemplateSearchModalto consume the factory-backed preference adapter.Test alignment
DEFAULT_TAB.Example of the new public API:
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)/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 flint /usr/local/bin/ps k/macroflows/macsort(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.