Skip to content

fix(components): align useResponsePanelCopy with onShow* naming#63

Merged
saagpatel merged 1 commit into
masterfrom
codex/fix/response-panel-copy-naming
Apr 22, 2026
Merged

fix(components): align useResponsePanelCopy with onShow* naming#63
saagpatel merged 1 commit into
masterfrom
codex/fix/response-panel-copy-naming

Conversation

@saagpatel
Copy link
Copy Markdown
Owner

What

Brings `useResponsePanelCopy` onto the same contract as the other 12 Wave 5.7 hooks:

  1. Rename `showSuccess`/`showError` params to `onShowSuccess`/`onShowError`.
  2. Route `export_draft` and `audit_response_copy_override` through the shared `draftTauriCommands` wrappers introduced in fix(components): inject tauri calls into useResponseActions #62.
  3. Generalize `exportDraft` to accept all three formats (`Markdown`, `PlainText`, `Html`) via a new `ExportDraftFormat` union.

Why

Two of the three Wave 5 post-audit findings:

How

  1. Update `useResponsePanelCopy.ts` param names and substitute the two `invoke` calls with imports from `./draftTauriCommands`.
  2. Extend `draftTauriCommands.ts`: `ExportDraftParams.format` widened from `"Markdown"` to a new exported `ExportDraftFormat` union.
  3. Update the single consumer `ResponsePanel.tsx` to pass `onShowSuccess: showSuccess`, `onShowError: showError`.

Testing

  • `pnpm tsc --noEmit` — clean.
  • `pnpm test` — 241 pass (unchanged count, same coverage).
  • `pnpm ui:gate:static` — exit 0.

Risk / Notes

  • Runtime behavior unchanged. Same tauri commands, same payloads.
  • No public API changes. `DraftTabHandle` still pinned; `ResponsePanel` props unchanged.
  • All 13 Wave 5 Draft hooks now follow one contract: state + deps in via options object, `onShow*` callbacks for toast surfaces, zero direct side-effect imports.

Rename showSuccess/showError params to onShowSuccess/onShowError to
match the convention used by the 12 other Wave 5.7 hooks. Also
move the two direct invoke calls (audit_response_copy_override,
export_draft) through the shared draftTauriCommands wrappers;
exportDraft now accepts all 3 formats (Markdown, PlainText, Html)
via an exported ExportDraftFormat union.
@saagpatel saagpatel merged commit a3b5010 into master Apr 22, 2026
16 of 17 checks passed
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