Skip to content

feat(dashboard): move email-joke sender filter to Agent Configs tab#567

Merged
zbigniewsobiecki merged 1 commit intodevfrom
feat/email-joke-agent-configs-tab
Feb 27, 2026
Merged

feat(dashboard): move email-joke sender filter to Agent Configs tab#567
zbigniewsobiecki merged 1 commit intodevfrom
feat/email-joke-agent-configs-tab

Conversation

@zbigniewsobiecki
Copy link
Copy Markdown
Member

Summary

  • Moves EmailJokeConfig sender filter from the Email integration tab to the Agent Configs tab, under an "Email Triggers" section inside the expanded email-joke section. Email integration is shared infrastructure; the sender filter is agent-specific trigger config.
  • Adds email-joke to ALL_AGENT_TYPES so it gets a first-class section in Agent Configs, identical to all other agents.
  • Removes the "Add Custom Agent Config" button — only agent types supported by the platform (defined in ALL_AGENT_TYPES) are valid.
  • Agent type field in the create/edit dialog is now always read-only — the type is always pre-decided from the section context, so a free-text input or dropdown is never needed.

Code quality fixes (identified via review)

# Issue Fix
Bug required on shadcn <Select> has no effect on form validation Removed the select; field is always read-only
Regression "Add Custom Agent Config" couldn't create non-listed types Button removed; unsupported types don't exist
UX "Add Config" from a section showed a mutable dropdown Now always read-only (type pre-seeded from context)
Architecture hasEmailTriggers was a magic string 'email-joke' in a generic component Replaced with EMAIL_TRIGGER_AGENTS.has() from trigger-agent-mapping
Consistency 'email-joke' absent from AGENT_TRIGGER_MAP Added 'email-joke': []
Type safety AGENT_LABELS was Record<string, string> in a separate file — drift-prone Moved to trigger-agent-mapping.ts as Record<KnownAgentType, string> — adding a new agent type without a label is now a compile error
Style Relative ./email-wizard.js import was inserted mid-block of @/ alias imports Moved to after all alias imports
Minor projectId was required on all AgentSection instances but only consumed by one Made optional with a doc comment

Lint / typecheck

  • Fixed pre-existing noExcessiveCognitiveComplexity biome warning in EmailWizard's multi-provider initialization useEffect with a targeted biome-ignore comment.
  • All biome check errors and warnings are clean.

Tests

Added 11 new tests in tests/unit/web/triggerAgentMapping.test.ts:

  • ALL_AGENT_TYPES includes email-joke and matches expected order
  • AGENT_LABELS has a label for every type in ALL_AGENT_TYPES, no extras
  • EMAIL_TRIGGER_AGENTS contains email-joke, only known types, not non-email agents
  • getTriggersForAgent('email-joke') returns empty array in all filter combinations

Test plan

  • Project Settings → Agent Configs → expand Email Joke → shows "Email Triggers" section with sender filter input
  • Project Settings → Integrations → Email tab → no longer shows the sender filter widget
  • Click Add Config on any agent section → dialog opens with type pre-filled and read-only (friendly label shown)
  • Click Edit Config on an existing config → same read-only behaviour
  • All 3376 unit tests pass

🤖 Generated with Claude Code

The EmailJokeConfig sender filter widget was placed in the Email
integration tab, but it is agent-specific trigger configuration and
belongs in the Agent Configs tab alongside PM and SCM triggers.

Changes:
- Add 'email-joke' to ALL_AGENT_TYPES so it appears as a section in
  Agent Configs
- Move AGENT_LABELS to trigger-agent-mapping.ts and type it as
  Record<KnownAgentType, string> — adding a new agent type without a
  label is now a compile error rather than a silent fallback
- Export EMAIL_TRIGGER_AGENTS (Set<KnownAgentType>) from
  trigger-agent-mapping.ts — replaces the magic string 'email-joke'
  that was hard-coded in the generic AgentSection component
- Add 'email-joke': [] to AGENT_TRIGGER_MAP for consistency with all
  other known agent types
- Render EmailJokeConfig inside the email-joke AgentSection under an
  "Email Triggers" heading when expanded
- Remove EmailJokeConfig from the integration-form email tab
- Remove "Add Custom Agent Config" button — only supported agent types
  defined in ALL_AGENT_TYPES are valid; per-section "Add Config"
  buttons pre-seed the type so it is always read-only in the dialog
- Suppress pre-existing noExcessiveCognitiveComplexity biome warning
  in EmailWizard's multi-provider initialization useEffect
- Add tests for AGENT_LABELS, EMAIL_TRIGGER_AGENTS, ALL_AGENT_TYPES
  completeness, and email-joke trigger definitions

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@zbigniewsobiecki zbigniewsobiecki merged commit 79a9bf8 into dev Feb 27, 2026
6 checks passed
@zbigniewsobiecki zbigniewsobiecki deleted the feat/email-joke-agent-configs-tab branch February 27, 2026 10:47
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.

1 participant