8000 DT-3070: Add codec server form component by rossnelson · Pull Request #2797 · temporalio/ui · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

DT-3070: Add codec server form component #2797

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to 8000 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open

Conversation

rossnelson
Copy link
Collaborator
@rossnelson rossnelson commented Jun 30, 2025

Description & motivation 💭

Creates a reusable codec server configuration form following the established patterns from search- 8000 attributes-form. The implementation emphasizes component abstraction to reduce code duplication while maintaining clean separation of concerns.

Key architectural decisions include using the SuperForms + reactive adapter pattern for flexible data integration, extracting common form components (Message and TaintedBadge) to eliminate duplication between forms, and implementing smart section visibility where the custom error section automatically shows when values are populated.

The form integrates comprehensive i18n support with proper translation templating for HTML links, uses Zod schema validation for URL requirements and type safety, and includes tainted state tracking with visual feedback through badge indicators.

Screenshots (if applicable) 📸

Empty Prefilled
CleanShot 2025-07-01 at 12 59 47 CleanShot 2025-07-01 at 12 59 50

Storybook stories available at Forms/Codec Server Form showing:

  • Empty form state with endpoint input and toggles
  • Prefilled form with custom error section expanded
  • Loading skeleton states

Storybook Links

Design Considerations 🎨

  • Uses toggle switches instead of checkboxes for better UX
  • Smart visibility for custom error section (shows when values populated)
  • Matches existing search attributes form patterns and styling
  • Tainted state badge on save button shows change count

Testing 🧪

How was this tested 👻

  • Manual testing
  • E2E tests added
  • Unit tests added

Manual Testing Steps

  • Tested form validation for required URL endpoints
  • Verified toggle switches work correctly
  • Confirmed custom section expand/collapse behavior
  • Validated tainted state tracking and badge display
  • Tested skeleton loading states
  • Verified Storybook stories render properly

Steps for others to test: 🚶🏽‍♂️🚶🏽‍♀️

  1. View Storybook: Forms/Codec Server Form
  2. Test different form states (Default, Prefilled)
  3. Validate URL requirements in endpoint field
  4. Toggle access token and CORS credentials switches
  5. Expand custom section and test remove functionality
  6. Verify save button badge shows when form is modified

Checklists

Draft Checklist

  • Component implementation complete
  • Storybook stories created
  • Documentation written
  • Linting and type checking passing

Merge Checklist

  • Supports custom error messaging and redirect links for codec failures
  • Integrates with existing settings API for persistence
  • Maintains form state with proper validation and error handling

Issue(s) closed

DT-3070

Docs

Any docs updates needed?

Component includes comprehensive MDX documentation in Storybook with usage examples and API reference.

Implement codec server configuration form using search-attributes-form as template:

- Form fields: endpoint URL, access token toggle, CORS credentials toggle
- Expandable custom error message and redirect link section
- Smart visibility logic for custom fields when values are populated
- Zod validation for required URL endpoints and optional custom links
- Toggle switches for better UX instead of checkboxes
- Tainted state tracking with badge on save button
- SuperForms integration with dataType: 'json' and resetForm: false
- Skeleton loading states matching existing patterns
- API integration with codec adapter for OSS endpoints
- Storybook documentation and examples
- Direct imports (no barrel exports) for better tree shaking
- Svelte 5 state management instead of legacy stores
Copy link
vercel bot commented Jun 30, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
holocene ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 3, 2025 6:30pm

- Use fetchSettings() from settings-service instead of direct API calls
- Properly integrate with existing Settings type structure
- Follow same pattern as other codec functionality in codebase
- Clear messaging about development limitations vs actual functionality
- Remove namespace parameter from createCodecAdapter() for OSS
- OSS operates at cluster level, Cloud will be namespace-scoped
- Update messaging and documentation to reflect cluster-level scope
- Prepare for future Cloud adapter implementation
Create FormMessage component to handle both form validation errors and status messages. Abstract TaintedBadge logic from duplicated implementations in both forms.
- Move form components to /form/ directory and rename for better organization
- Make TaintedBadge and Message components "dumb" - accept resolved values instead of stores
- Add comprehensive i18n translations for codec server form
- Fix search attributes form reset function error
- Clean up component interfaces with better prop naming (message -> value, formErrors -> errors)
- Extract tainted count calculation to derived variables in parent components
- Add proper TypeScript types for Alert intent
…ating

- Replace custom HTML link with Holocene Link component for better consistency
- Split endpoint description into prefix/suffix pattern for cleaner templating
- Remove manual styling in favor of component defaults
- Follow cloud-ui patterns for codec server endpoint links
@rossnelson rossnelson marked this pull request as ready for review July 1, 2025 17:27
@rossnelson rossnelson requested review from rossedfort and a team as code owners July 1, 2025 17:27
passUserAccessToken: codecSettings?.passAccessToken || false,
includeCrossOriginCredentials: codecSettings?.includeCredentials || false,
customMessage: codecSettings?.customErrorMessage?.default?.message || '',
customLink: codecSettings?.customErrorMessage?.default?.link || '',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets prefer ?? over ||.

Move retry state and logic from callers into ApiError component itself.
Components now pass retryConfig with retryFn instead of managing
retry state externally.

- Add internal retry state (retryCount, isRetrying)
- Replace onRetry callback with retryConfig interface
- Add loading state during retry operations
- Simplify caller interface to config-based approach
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0