Repository navigation
fix(forge): templates screens under the fallow limits - #991
Merged
Merged
Conversation
Split TemplatesScreen and TemplateSheet into hooks and subcomponents, share the list loading grid and error card between the agents and templates screens, and move the shared card surface CSS into one tile-card stylesheet. No behaviour change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Why
main's CI
testjob fails atnpm run fallowbecause of the Templates screen from #985:TemplateSheet(cognitive 18, cyclomatic 21) andTemplatesScreen(cognitive 18) inapps/agent-forge/src/screens/templates/are over the limits.AgentListScreen.tsx:50-67repeatsTemplatesScreen.tsx:46-63(the loading grid and the error card), andagentCard.css:13-23repeatstemplates.css:76-86(the card surface).This PR splits the components and shares the repeated code. Thresholds, ignores and the fallow config are unchanged. The other red merges in the last 10 (#984, #986) failed on
LabelsDialog, which #988 already fixed.Changes
Behaviour is unchanged:
TemplatesScreen.tsx:useTemplateList()holds the list fetch, its error and Retry.CategoryPillsrenders the category filter.TemplatesBodypicks one of the error card, the loading grid, the empty state or the grid.TemplateSheet.tsx:useTemplateDetail(templateId)holds the detail fetch, the stale-id guard and Retry.useCreateFromTemplate(templateId, title)holds the create, toast and navigate.TemplateSheetDetailrenders the requirements and the README.screens/listStates.tsxwithLoadingGrid(six skeletons plus the hidden status line) andLoadErrorCard(error card with Retry). Both screens now use them in place of their own copies.ui/tileCard.csswith a.tile-cardclass: the surface, border, radius, shadow, hover and reduced-motion rules that.agent-cardand.template-cardboth had.AgentCardandTemplateCardadd the class and import the stylesheet. It still loads afteragents.css, so the cascade is the same.Testing
TemplatesScreen.test.tsxcover the behaviour that moved and had no test: an unknown?category=falls back to All, and the All pill clears the filter; a template with no requirements shows the note; Cancel closes the sheet; an unknown id showsNo template '<id>'.with the id as the title. Both passed on the old code before the refactor and still pass after it.typecheckandtypecheck:serverpass, and eslint has no errors.fallow health --complexitywith an empty coverage file: no templates or agent list function is listed.fallow dupesfinds no duplication, andfallow dead-codefinds no issues.🤖 Generated with Claude Code