Skip to content
PreviewAn agent answered the case. Staff can close it.

Support

case_4a8c12e0
6d 22h left

Facts

Ground
Support request
Account
Ada Lovelace usr_8f2a
Source
msg_904b
Text sent
lib_export_steps
Waits on
Other side

What was done

  1. Ops, for MayaNov 20, 10:00 AM

    Opened case from support mail msg_904b.

  2. Ops, for MayaNov 20, 10:02 AM

    Sent library text lib_export_steps.

import { useState } from "react";
import { Button } from "@arcadia/ui";

function SupportCase() {
  const [closed, setClosed] = useState(false);
  const acts: CaseAct[] = [
    { id: "a1", who: OPS, line: "Opened case from support mail msg_904b.", at: NOW - 2 * HOUR },
    { id: "a2", who: OPS, line: "Sent library text lib_export_steps.", at: NOW - 2 * HOUR + 2 * MIN },
    ...(closed ? [{ id: "a3", who: MAYA, line: "Closed case as answered.", at: NOW }] : []),
  ];
  return (
    <CaseScreen
      kind="support"
      caseId="case_4a8c12e0"
      dueAt={NOW + 6 * DAY + 22 * HOUR}
      outcome={closed ? "Answered" : undefined}
      facts={[
        { label: "Ground", value: "Support request" },
        { label: "Account", value: <>Ada Lovelace {readout("usr_8f2a")}</> },
        { label: "Source", value: readout("msg_904b") },
        { label: "Text sent", value: readout("lib_export_steps") },
        { label: "Waits on", value: closed ? "Ended" : "Other side" },
      ]}
      acts={acts}
      next={closed
        ? <Button variant="secondary" onClick={() => setClosed(false)}>Reopen case</Button>
        : <Button variant="primary" onClick={() => setClosed(true)}>Close case</Button>}
    />
  );
}

TSX
<article>
  <header>
    <h1>{caseKindLabel(c.kind)}</h1>
    <CaseClock dueAt={c.dueAt} />
  </header>
  <section>
    <h2>Facts</h2>
    <Facts items={c.facts} />
  </section>
  <section>
    <h2>What was done</h2>
    <ol role="list">{c.acts.map((entry) => <ActRow key={entry.id} entry={entry} />)}</ol>
  </section>
  {c.ask ? <Ask you choices={c.ask.choices} otherwise={c.ask.otherwise} askedOf={owner} onAnswer={onAnswer} /> : <Button variant="primary">{c.nextLabel}</Button>}
</article>

Show IDs, counts and timestamps, never messages, attachments or previews.

Use one primary action for staff or an Ask for the owner.

Examples

Abuse case with a contest

Review a temporary limit after the account contests it.

Preview

Abuse

case_9d2f88c1
18h 40m left

Facts

Ground
Abuse prevention
Account
Nora Lind usr_3b0c
Signal
Unanswered invitations to strangers (8 of last 10)
Burst
412 events in last hour across 19 accounts
Automatic act
Level narrow for 7 days
Statement
stmt_2b7d
Contest
cnt_51e8

What was done

  1. Ops, for MayaNov 19, 1:00 PM

    Applied narrow limits for 7 days on signal invite.unanswered (8 of last 10).

  2. Ops, for MayaNov 19, 1:01 PM

    Sent statement of reasons stmt_2b7d.

  3. Nora LindNov 19, 3:00 PM

    Filed contest cnt_51e8.

import { useState } from "react";
import { Button } from "@arcadia/ui";

function AbuseContest() {
  const [lifted, setLifted] = useState(false);
  const acts: CaseAct[] = [
    { id: "b1", who: OPS, line: "Applied narrow limits for 7 days on signal invite.unanswered (8 of last 10).", at: NOW - 23 * HOUR },
    { id: "b2", who: OPS, line: "Sent statement of reasons stmt_2b7d.", at: NOW - 23 * HOUR + MIN },
    { id: "b3", who: NORA, line: "Filed contest cnt_51e8.", at: NOW - 21 * HOUR },
    ...(lifted ? [{ id: "b4", who: MAYA, line: "Lifted narrow limits and ended contest.", at: NOW }] : []),
  ];
  return (
    <CaseScreen
      kind="abuse"
      caseId="case_9d2f88c1"
      dueAt={NOW + 18 * HOUR + 40 * MIN}
      outcome={lifted ? "Lifted" : undefined}
      facts={[
        { label: "Ground", value: "Abuse prevention" },
        { label: "Account", value: <>Nora Lind {readout("usr_3b0c")}</> },
        { label: "Signal", value: "Unanswered invitations to strangers (8 of last 10)" },
        { label: "Burst", value: "412 events in last hour across 19 accounts" },
        { label: "Automatic act", value: "Level narrow for 7 days" },
        { label: "Statement", value: readout("stmt_2b7d") },
        { label: "Contest", value: readout("cnt_51e8") },
      ]}
      acts={acts}
      next={lifted
        ? <Button variant="secondary" onClick={() => setLifted(false)}>Reset example</Button>
        : <Button variant="primary" onClick={() => setLifted(true)}>Lift limit</Button>}
    />
  );
}

Urgent notice

The owner can answer without seeing the reported content.

Preview

Urgent notice

case_f019a3c4
Overdue 14m

Facts

Ground
Urgent notice
Item
itm_9a31e4
Item kind
Image
Product
Crew
Report
rpt_3c80
Item state
Hidden automatically, sealed
Owner notice
Held until decision

What was done

  1. Ops, for MayaNov 20, 11:46 AM

    Item itm_9a31e4 hidden automatically on receipt of report rpt_3c80.

  2. Ops, for MayaNov 20, 11:46 AM

    Sealed item copy and sent ask to owner.

Urgent notice on image itm_9a31e4

Otherwise Item stays hidden and sealed until you decide.

import { useState } from "react";
import { Ask, fmtTime, StatusDot } from "@arcadia/ui";

function UrgentNotice() {
  const [state, setState] = useState<AskState>("open");
  const [answer, setAnswer] = useState<{ text: string; at: string }>();
  const [acts, setActs] = useState<CaseAct[]>([
    { id: "u1", who: OPS, line: "Item itm_9a31e4 hidden automatically on receipt of report rpt_3c80.", at: NOW - 14 * MIN },
    { id: "u2", who: OPS, line: "Sealed item copy and sent ask to owner.", at: NOW - 14 * MIN + 10_000 },
  ]);
  const decide = (reply: AskReply) => {
    const choice = "choice" in reply ? reply.choice : "choices" in reply ? reply.choices.join(", ") : "words" in reply ? reply.words : reply.offer;
    setAnswer({ text: choice, at: fmtTime(NOW) });
    setState("answered");
    setActs((prev) => [...prev, { id: `u_${prev.length + 1}`, who: MAYA, line: `Recorded decision: ${choice}.`, at: NOW }]);
  };
  return (
    <CaseScreen
      kind="notice.urgent"
      caseId="case_f019a3c4"
      dueAt={NOW - 14 * MIN}
      outcome={state === "answered" ? answer?.text : undefined}
      facts={[
        { label: "Ground", value: "Urgent notice" },
        { label: "Item", value: readout("itm_9a31e4") },
        { label: "Item kind", value: "Image" },
        { label: "Product", value: "Crew" },
        { label: "Report", value: readout("rpt_3c80") },
        { label: "Item state", value: "Hidden automatically, sealed" },
        { label: "Owner notice", value: "Held until decision" },
      ]}
      acts={acts}
      next={(
        <div {...sx("case-ask", page.ask)}>
          <p {...sx("case-ask-lead", page.askLead)}>
            {state === "open" && <StatusDot status="attention" label={null} />}
            <span>Urgent notice on image {readout("itm_9a31e4")}</span>
          </p>
          <Ask
            you
            choices={URGENT_CHOICES}
            otherwise="Item stays hidden and sealed until you decide."
            askedOf="Maya"
            state={state}
            answer={answer}
            onAnswer={decide}
          />
        </div>
      )}
    />
  );
}

Narrow column

The deadline and choices wrap without horizontal scrolling.

Preview

Urgent notice

case_f019a3c4
Overdue 14m

Facts

Ground
Urgent notice
Item
itm_9a31e4
Item kind
Image
Product
Crew
Report
rpt_3c80
Item state
Hidden automatically, sealed
Owner notice
Held until decision

What was done

  1. Ops, for MayaNov 20, 11:46 AM

    Item itm_9a31e4 hidden automatically on receipt of report rpt_3c80.

  2. Ops, for MayaNov 20, 11:46 AM

    Sealed item copy and sent ask to owner.

Urgent notice on image itm_9a31e4

Otherwise Item stays hidden and sealed until you decide.

<div {...sx("case-narrow", page.narrow)}>
  <UrgentNotice />
</div>

Each case is an article named by its heading. Facts are a definition list, and actions and timestamps follow in reading order.

Tab
Move to the next-act button or each choice in the Ask
Enter
Activate the next act or choose an answer
Space
Activate the focused button