email reply fixes
This commit is contained in:
parent
8653f319f7
commit
d58fb8841b
5 changed files with 100 additions and 85 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import { MoreHorizontal, Plus, UserRound } from "lucide-react";
|
||||
import { Info, MoreHorizontal, Plus, UserRound } from "lucide-react";
|
||||
import { useCallback, useEffect, useState } from "react";
|
||||
import {
|
||||
createHandoffRule,
|
||||
|
|
@ -9,7 +9,7 @@ import {
|
|||
} from "../api";
|
||||
import AgentSpark from "./AgentSpark";
|
||||
import HumanHandoffDrawer from "./HumanHandoffDrawer";
|
||||
import { buildRuleCardSummary, EMAIL_TYPE_OPTIONS } from "../utils/handoffUtils";
|
||||
import { buildRuleCardChips, EMAIL_TYPE_OPTIONS } from "../utils/handoffUtils";
|
||||
|
||||
function typeLabel(id) {
|
||||
return EMAIL_TYPE_OPTIONS.find((item) => item.id === id)?.title || id;
|
||||
|
|
@ -128,14 +128,12 @@ export default function HandoffSettings() {
|
|||
|
||||
return (
|
||||
<div className="handoff-settings">
|
||||
<div className="handoff-settings-intro">
|
||||
<p>
|
||||
<strong>Configure Human Handoff rules for your Agent.</strong>
|
||||
</p>
|
||||
<p>
|
||||
Saved settings are stored for future use. They do not send, forward, mirror, or relay
|
||||
email today — all mail continues through the normal Gentic inbox and outbox.
|
||||
</p>
|
||||
<div className="handoff-settings-notice">
|
||||
<Info size={14} strokeWidth={2} className="handoff-settings-notice-icon" aria-hidden="true" />
|
||||
<div>
|
||||
<strong>Configuration only</strong>
|
||||
<p>Handoff rules are saved as configuration only. Email routing remains unchanged.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="handoff-settings-toolbar">
|
||||
|
|
@ -155,10 +153,7 @@ export default function HandoffSettings() {
|
|||
<UserRound size={24} strokeWidth={1.75} />
|
||||
</div>
|
||||
<h2>No handoff rules yet</h2>
|
||||
<p>
|
||||
Configure when your Agent should involve a Human Owner. Settings are saved only;
|
||||
no emails are sent automatically.
|
||||
</p>
|
||||
<p>Configure when your Agent should involve a Human Owner.</p>
|
||||
<button type="button" className="handoff-btn primary" onClick={openCreate}>
|
||||
<Plus size={16} strokeWidth={1.75} /> Add handoff rule
|
||||
</button>
|
||||
|
|
@ -167,46 +162,47 @@ export default function HandoffSettings() {
|
|||
<div className="human-handoff-list">
|
||||
{rules.map((rule) => (
|
||||
<article key={rule.id} className="human-handoff-card">
|
||||
<div className="human-handoff-card-top">
|
||||
<div className="human-handoff-card-body">
|
||||
<span className="human-handoff-card-avatar" aria-hidden="true">
|
||||
<UserRound size={18} strokeWidth={1.75} />
|
||||
<UserRound size={17} strokeWidth={1.75} />
|
||||
</span>
|
||||
<div className="human-handoff-card-meta">
|
||||
<strong>{rule.owner_name}</strong>
|
||||
<small>{rule.owner_email}</small>
|
||||
</div>
|
||||
<strong className="human-handoff-card-name">{rule.owner_name}</strong>
|
||||
<span className={`human-handoff-status${rule.active ? " active" : ""}`}>
|
||||
{rule.active ? "Active" : "Paused"}
|
||||
</span>
|
||||
</div>
|
||||
<p className="human-handoff-card-summary">{buildRuleCardSummary(rule)}</p>
|
||||
{rule.instructions && (
|
||||
<blockquote className="human-handoff-card-quote">“{rule.instructions}”</blockquote>
|
||||
)}
|
||||
<div className="human-handoff-card-actions">
|
||||
<button type="button" className="handoff-btn subtle" onClick={() => openEdit(rule)}>Edit</button>
|
||||
<div className="handoff-card-menu-wrap">
|
||||
<button
|
||||
type="button"
|
||||
className="handoff-btn icon"
|
||||
aria-label="More actions"
|
||||
onClick={() => setMenuOpenId((current) => (current === rule.id ? null : rule.id))}
|
||||
>
|
||||
<MoreHorizontal size={16} strokeWidth={1.75} />
|
||||
<small className="human-handoff-card-email">{rule.owner_email}</small>
|
||||
<div className="human-handoff-card-actions">
|
||||
<button type="button" className="handoff-btn subtle" onClick={() => openEdit(rule)}>
|
||||
Edit
|
||||
</button>
|
||||
{menuOpenId === rule.id && (
|
||||
<div className="handoff-card-menu">
|
||||
<button type="button" onClick={() => openTest({
|
||||
owner_email: rule.owner_email,
|
||||
labels: rule.labels,
|
||||
email_types: rule.email_types,
|
||||
instructions: rule.instructions,
|
||||
})}>Test with an email</button>
|
||||
<button type="button" onClick={() => handleDelete(rule)}>Delete</button>
|
||||
</div>
|
||||
)}
|
||||
<div className="handoff-card-menu-wrap">
|
||||
<button
|
||||
type="button"
|
||||
className="handoff-btn icon quiet"
|
||||
aria-label="More actions"
|
||||
onClick={() => setMenuOpenId((current) => (current === rule.id ? null : rule.id))}
|
||||
>
|
||||
<MoreHorizontal size={16} strokeWidth={1.75} />
|
||||
</button>
|
||||
{menuOpenId === rule.id && (
|
||||
<div className="handoff-card-menu">
|
||||
<button type="button" onClick={() => openTest({
|
||||
owner_email: rule.owner_email,
|
||||
labels: rule.labels,
|
||||
email_types: rule.email_types,
|
||||
instructions: rule.instructions,
|
||||
})}>Test with an email</button>
|
||||
<button type="button" onClick={() => handleDelete(rule)}>Delete</button>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="human-handoff-card-chips">
|
||||
{buildRuleCardChips(rule).map((chip) => (
|
||||
<span key={chip} className="handoff-meta-chip">{chip}</span>
|
||||
))}
|
||||
</div>
|
||||
</article>
|
||||
))}
|
||||
</div>
|
||||
|
|
@ -227,7 +223,7 @@ export default function HandoffSettings() {
|
|||
<header className="handoff-drawer-head">
|
||||
<div>
|
||||
<h2 id="handoff-test-title">Test Human Handoff</h2>
|
||||
<p>Check whether your current rules would cause a particular email to be handed to you.</p>
|
||||
<p>Check whether your current rules would match a particular email.</p>
|
||||
</div>
|
||||
</header>
|
||||
<div className="handoff-drawer-body">
|
||||
|
|
|
|||
|
|
@ -6,10 +6,7 @@ export default function HumanHandoff() {
|
|||
<header className="human-handoff-head">
|
||||
<div>
|
||||
<h1>Human Handoff</h1>
|
||||
<p>
|
||||
Configure when your Agent should involve a Human Owner. Settings are saved here;
|
||||
email routing is not affected until handoff is enabled in a future release.
|
||||
</p>
|
||||
<p>Configure when your Agent should involve a Human Owner.</p>
|
||||
</div>
|
||||
</header>
|
||||
<HandoffSettings />
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue