# Journey work cells

> **2026-10-08:** the former `JourneyWorkPanel.vue` (a separate work-queue selector above the chart) was deleted. The
> four work filters now live inside the live workspace — see
> [Sales flow chart → Work filters](/docs/modules_handbook/shared/sales-flow-chart/readMe.md#work-filters). This doc
> now covers the row cells that remain shared.

## What it does

The shared cells that render one customer row of a sales-flow roster: who the customer is and how to reach them,
the work the row is listed under with its **Pending** / **Done** buttons, and the last contact anyone recorded.
They are used by the live sales-flow workspace (company page and a funnel's Journey tab) and by My Work's
responsibilities, so a row reads the same everywhere.

## How it works

- **`JourneyContactCell`** — the customer's name (a button opening the **lead quick-view modal** on Sales → Journey
  — `useLeadModal().openLead(uuid, JOURNEY_TABS)`; the roster is never left, 2026-10-09), phone through
  `CallLogButton` (the recording-phone confirmation and call-start record; it does not dial or complete anything) and,
  when the server sent `contact.whatsapp_url` and the viewer has a WhatsApp permission, the inbox search.
- **`JourneyWorkCell`** — the row's **primary item** (`item`, default `row.items[0]`): its title, Session / Project
  context, state badge, due label and owner, ONE "what to do" sentence (`WhatToDo`, "more" opens the rest), its
  `LastContactLine`, and the **Pending** / **Done** buttons (`FunnelFollowUpButton`) when the item is not done and carries
  an `action_context` or a `work.outcome_url`. Below it: the step's own link when it is not just the customer page
  (always shown for a paid service step, which completes from that record — D4; hidden when the button already
  records the same thing), and **Open customer** (the lead modal on Sales → Journey). A step link that points at
  the lead's own page (`/manage/leads/{uuid}?tab=…`, e.g. a paid step's `?tab=portal&ptab=fpa`) opens the modal on
  that tab instead (`utils/leadModalLink.js` → `leadModalTarget(href)`); any other link (Sales Projects, a task on
  My Work) stays an Inertia link.
- **Pending / Done feedback** — `FunnelFollowUpButton` posts both paths as a plain XHR (`X-Requested-With`), so a
  save comes back as a status and the button shows a **toast** itself (the context path's own message; on the task
  path "Outcome recorded. The task is done." or "Attempt recorded. The task stays open for another try." by the
  chosen result); a refusal (409 already closed / conflict, 403, 422) stays in the form. A board then reloads only
  its own prop — the agreed-Session registration adds `flash` to it, so its "Lead added to the session." shows.
- **`LastContactLine`** — "Last contact: Spoke to them · 8 Oct · by Shawn · next 12 Oct", the note, and a recorded
  Not closed with its reason. Whoever recorded it, everyone sees the same line (D5).
- **`WhatToDo`** — the first sentence of a server reason, with the rest behind "more".

Everything shown is server-owned (`work.kind`, `reason`, `due_label`, `assignee`, `label`, `href`, `outcome_url`,
`action_context`, `last_contact`); the cells never derive a write target or a deadline. Every internal link keeps
`suite`. **Opening a customer is always the lead modal, never navigation to `/manage/leads/{uuid}`** (owner,
2026-10-09) — the server may keep sending lead-page hrefs; the cells convert them. That includes the expanded row's
**Shared financial preparation** cells: `EngagementProgressCell` with `fpa-in-place` renders each FPA step as a
button emitting `open-fpa` with its lead-page link, which the workspace opens in the modal (Property Portal →
Financial Report) through `leadModalTarget()`. Without the prop (the Sales pages) the cell stays a link.

## Reference usage

`resources/js/Pages/Manage/MyWork/Partials/SalesJourneyWorkspace.vue` renders `JourneyContactCell` in the Customer
column and `JourneyWorkCell :lead="row" :item="primary(row)" :reload-only="reloadOnly"` in the Work column of its
`DataTable`; the expanded row lists every item with `ResponsibilityItem` (My Work's item card, which uses the same
`FunnelFollowUpButton` and `LastContactLine`); its **Open the customer's full Journey** is the modal too.
My Work's `ResponsibilityRows.vue` uses `JourneyContactCell` the same way, with `ResponsibilityItem` (compact) as
its work cell. The workspace roster's `#` column keeps counting across pages (`DataTable`'s `index-offset` =
`(roster.page − 1) × 25`, the boards' shared `PreviewJourneyBoard::PAGE_SIZE`).

## Related files

- `resources/js/Components/Leads/{JourneyContactCell,JourneyWorkCell,LastContactLine,WhatToDo}.vue`
- `resources/js/Components/Leads/FunnelFollowUpButton.vue` — [Pending / Done](/docs/modules_handbook/shared/sales-flow-chart/record-contact.md)
- `resources/js/Components/CallLogButton.vue`
- `resources/js/Pages/Manage/MyWork/Partials/{SalesJourneyWorkspace,ResponsibilitiesBoard,ResponsibilityRows,ResponsibilityItem}.vue`
- `resources/js/utils/leadModalLink.js` — `JOURNEY_TABS`, `leadModalTarget(href)`; `resources/js/composables/useLeadModal.js`
- `resources/js/Components/Sales/EngagementProgressCell.vue` — the FPA cells (`fpa-in-place` / `open-fpa`)
- `src/Lead/Journey/JourneyWorkQueue.php` — the server side of `work`, `action_context` and the work filters
