Skip to content

feat(action-center): copy or export everything an action shows - #1070

Merged
gkhngyk merged 15 commits into
ansvisor:mainfrom
cihan-gyk:feature/action-export
Oct 17, 2026
Merged

gkhngyk merged 15 commits into
ansvisor:mainfrom
cihan-gyk:feature/action-export

Conversation

@cihan-gyk

Copy link
Copy Markdown
Collaborator

Summary

AC-005, with Excel added on request: every action's drawer gets Copy Data, Export CSV and Export Excel in its header. Stacked on #1058 for the signals' platforms and locations; please review the second commit, feat(action-center): copy or export everything an action shows, or merge #1058 first.

Copy Data

  • The window: a click opens the whole action as Markdown, everything the drawer's tabs show:

    Part Contains
    Header ID, title, category, impact, status, assignee, due date, tags
    Overview Why, Goal, KPIs, and what a person sent it from (see below)
    Tasks Each task with its status, its details, and a skip reason
    Signals Type, platforms, locations, detected date, what it is about, status
    History The History tab
    Link Back to the action
  • What it was sent from:

    • an Improve action's prompt, platforms and link;
    • a content opportunity's title, decision, pages, brief, prompts and searches, read as its Overview reads them.
  • Copying: the reader can select any part to copy, or copy all of it with the icon in the text's corner. The icon turns into a check, and a toast says "Action AC-52 copied: 6 tasks, 87 signals".

  • Blocked clipboard: where the clipboard API is blocked (an insecure page, an embedded browser), the icon falls back to the browser's copy command. The spec asks for this.

Export CSV

  • File: action-AC-52.csv, as the spec names it, UTF-8 with a BOM so Excel keeps Turkish characters.
  • Rows: one per task and one per signal, marked by a section column (task / signal). Every row also carries action (AC-52) and the shared columns: type, entity, status, platforms, locations, dates and link.
  • Formulas: formula-looking cells are kept as text (toCsv).

Export Excel

  • File: action-AC-52.xlsx, with a sheet each for the action, its tasks, its signals and its history. Headers are bold and the header row is sticky.
  • New package: write-excel-file 4.1.1 (MIT, one dependency, fflate, already in the lockfile). It is by the author of read-excel-file, which we already use, and is loaded only when someone asks for a workbook.

Shared code

  • History lines: actionEventText moves the History sentence into display.ts, so the drawer and the export say the same thing.
  • Opportunity lists: opportunityLists (lib/content) is what both the drawer and the export list of an opportunity.
  • Dates: in the reader's time zone (lib/time-zone).

Not in this PR

These AC-005 items wait on other work:

Item Waits on
The affected list (affected rows) AC-003
Priority score and "Why this priority?" AC-006
New columns in the list-level CSV AC-003, AC-006
The API/MCP format Separate work

Review

I ran a code review before the final changes. All seven findings are fixed:

  • the byte order mark was written as an invisible character;
  • Improve and opportunity context were missing;
  • AI answer ids were exported as raw UUIDs;
  • dates and file names were in UTC;
  • the download link was revoked too early;
  • the CSV had no test;
  • an action row was mixed into the CSV.

Related issue

None. Product spec AC-005 (Action Center), plus Excel.

Type of change

  • feat — New feature
  • fix — Bug fix
  • chore — Maintenance / dependencies
  • docs — Documentation only
  • refactor — Code change that neither fixes a bug nor adds a feature
  • test — Adding or updating tests

How to test

  1. Open any action in Action Center → Actions.
  2. Copy Data:
    • a window shows the action as Markdown;
    • select part of it and press ⌘C, or click the copy icon to copy all;
    • check the toast, then paste into a doc.
  3. Export CSV: action-AC-<n>.csv opens in Excel and Google Sheets with Turkish characters intact, one row per task and signal.
  4. Export Excel: action-AC-<n>.xlsx has the Action, Tasks, Signals and History sheets.
  5. For an action sent from Content Optimization, Copy Data includes the opportunity's pages, brief and prompts.

Checklist

  • Branch follows the naming convention (feature/, fix/, chore/, docs/) — see CONTRIBUTING.md
  • Commits follow Conventional Commits
  • yarn lint passes (run from web/): 0 errors; the 7 warnings are in files this PR doesn't touch
  • yarn typecheck passes (run from web/)
  • yarn format:check passes (run from web/)
  • Changes are focused — one concern per PR

Also run:

  • yarn test: 577/577. New:
    • export.test.ts: the export model, Markdown, CSV, workbook and file names. It also writes the real .xlsx and reads it back with read-excel-file.
    • action-export-buttons.test.tsx:
      • the window and the one-click copy;
      • the copy-command fallback and its failure;
      • the opportunity context;
      • the CSV's BOM and name;
      • the workbook's sheets.
  • yarn build: passes.
  • In the browser:
    • the drawer and the window, in light and dark mode, at 1440px and 1024px;
    • in the app's embedded browser, which blocks the clipboard API, the copy icon copied in one click through the fallback.

🤖 Generated with Claude Code

cihan-gyk and others added 2 commits October 15, 2026 14:20
…ls by platform

The Signals list never said which AI platform or location a signal was
about, and named platforms by their raw ids ("Visibility dropped on
gemini-web", "Weak in JP"). Part one of AC-002:

- Each row's Affected cell gets a line with the engines and locations the
  signal is about: from the payload for platform and country signals, and
  from the prompts' tracked platforms and locations for prompt and topic
  signals. A line rather than a column keeps the table within the page
  beside a pinned sidebar.
- Platforms and locations read as people know them ("Gemini", "Japan").
- Descriptions carry the measured fact instead of a generic sentence, e.g.
  "Your mention rate fell from 34% to 18% against the week before."
- A Platform filter, search over platform and location names, and
  platforms and locations columns in the CSV export.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Every action's drawer gets Copy Data, Export CSV and Export Excel
(AC-005). Copy Data opens the whole action as Markdown, every tab of the
drawer, to copy a part or all of it with one click; the copy falls back
to the browser's copy command where the clipboard API is blocked. The
CSV (action-AC-52.csv, UTF-8 with a BOM) has a row per task and per
signal marked by a section column; the Excel workbook has a sheet each
for the action, its tasks, its signals and its history. Adds the
write-excel-file package, loaded only when a workbook is asked for.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@cihan-gyk

Copy link
Copy Markdown
Collaborator Author

@gkhngyk AC-005 (plus Excel) ready for review: Copy Data, Export CSV and Export Excel on every action. Stacked on #1058: please review the last commit, or merge #1058 first. Adds one package, write-excel-file 4.1.1 (MIT), loaded on demand.

@gkhngyk gkhngyk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, approving. I merged main into the branch. With #1058 squashed and #1078, #1079 and #1101 in, the History line keeps your actionEventText, and the title and outcome values those PRs added inline now go through it, with a test. The drawer reads export buttons in the header, then the Status / Assignee / Due date row, then the tabs. Against main the diff is only this PR's files, and CI (including yarn test and yarn build with write-excel-file installed) is green.

@gkhngyk
gkhngyk merged commit e0204e9 into ansvisor:main Oct 17, 2026
5 checks passed
gkhngyk added a commit to cihan-gyk/ansvisor that referenced this pull request Oct 17, 2026
main carries ansvisor#1058 as a squash, so its files come from main and this branch keeps only its own commit on top; schema.sql is regenerated. The export fixtures from ansvisor#1070 gain SignalWhere's new topics field.
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