What problem does this address?
Code quality improvements identified during review of #76155, covering component structure and TypeScript typing.
Tracking Issue: #76384
What is your proposed solution?
1. Decompose actions-section into sub-components
The return statement in actions-section.tsx is long. Create an Action sub-component instead of the ACTIONS array + map + buttonProps pattern to improve readability.
Ref: #76155 (comment)
2. Fix error typing
Error type is unknown in catch blocks even though we control the throwing functions. Give errors a proper type.
Ref: #76155 (comment)
3. Refactor TypeScript types for guidelines
Introduce simple and complex guideline types. Use the exported store object instead of STORE_NAME string to avoid as unknown casts and get proper type inference.
Ref: #76155 (comment)
What problem does this address?
Code quality improvements identified during review of #76155, covering component structure and TypeScript typing.
Tracking Issue: #76384
What is your proposed solution?
1. Decompose actions-section into sub-components
The return statement in
actions-section.tsxis long. Create anActionsub-component instead of theACTIONSarray +map+buttonPropspattern to improve readability.Ref: #76155 (comment)
2. Fix error typing
Error type is
unknownin catch blocks even though we control the throwing functions. Give errors a proper type.Ref: #76155 (comment)
3. Refactor TypeScript types for guidelines
Introduce simple and complex guideline types. Use the exported store object instead of
STORE_NAMEstring to avoidas unknowncasts and get proper type inference.Ref: #76155 (comment)