8000 feat(timeline): show what an item caused, with Approve and Decline on waiting approvals by adeelahmad · Pull Request #642 · adeelahmad/lense · GitHub
[go: up one dir, main page]

Skip to content

feat(timeline): show what an item caused, with Approve and Decline on waiting approvals - #642

Merged
adeelahmad merged 1 commit into
mainfrom
claude/project-thread-pf8kii
Oct 18, 2026
Merged

adeelahmad merged 1 commit into
mainfrom
claude/project-thread-pf8kii

Conversation

@adeelahmad
Copy link
Copy Markdown
Owner

Requested by Adeel · project thread

Description

Before: an opened timeline item said which run caused it, but nothing about what it caused. To see that an email had started "School emails" and left a post waiting for a yes, you filtered the timeline by the automation or went to the Approvals page, and decided it there.

After: an opened item shows What this caused: each automation run it started (of the automations you manage, with its status and a link to the automation's runs) and each approval those runs asked you for, with what it would do and its status. An approval still waiting has Approve and Decline right there, so the pick is made where it was caused; an approval's own line ("School emails asks for your pick") lists that approval under Your pick. Items that caused nothing show no block. Agents read the same: GET /api/v1/activities/{id}/caused is {runs, approvals} with each approval's can, the MCP tool activity_caused returns it as approvals shows them, and approvals (API, MCP and the assistant) takes activity to list the approvals one item led to. Approving stays the person's: an agent lists and declines, as before.

How: approvals.listing gains an activity filter on why.activity (the activity an approval was asked about, already kept); the runs come from automations.caused through the same manage check as GET /automations/runs?activity=, now a shared caused_runs. The page's Caused component reads /caused when an item is opened and decides through the existing POST /api/v1/approvals/{id}, then reloads the approvals badge, the item and the timeline.

Motivation and Context

Step 9 of the activity stream design (thread above), and docs/timeline.md's last planned row: "What each item caused (automation runs, approvals), and Approve and Decline on waiting approvals". Follows #570, #622, #627, #631, #635 and #637.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change; ! in the title)

Checklist:

  • The title is a Conventional Commit.
  • My code follows the code style of this project (make hooks checks it on commit).
  • I added or updated tests.
  • My change requires documentation updates, and I have updated docs/ accordingly.
  • Users need more than the title to understand it, so I wrote it as a fragment in changelog.d/ (timeline-caused.md).

Done questions (AGENTS.md)

  • Goal: what each item caused, and the pick made from the item, for people and agents; merged on green CI.
  • Agents: GET /api/v1/activities/{id}/caused, GET /api/v1/approvals?activity=, MCP activity_caused and approvals (activity), the assistant's approvals (activity).
  • Zero setup: nothing to configure; it reads what runs and approvals already keep.
  • Fewest clicks: Approve or Decline is one click on the item, with no confirm; the runs are one click to the automation.
  • Configurable: n/a, no new setting.
  • Light: one small query for the runs and one for the approvals when an item is opened; no model call.
  • Private and secure: the runs are of automations the person manages and the approvals their own, over an activity they can already see (404 otherwise); deciding goes through the same approval endpoint with the same can rules (approving needs a signed-in session). No new surface for the threat model.
  • Cost: no model call; nothing in the ledger to log.
  • User decides: that is what it is for; nothing is decided without the click, and existing defaults are unchanged.
  • Upgrades: nothing stored changes shape; no migration.
  • Honest: docs/timeline.md's status table moves the row from planned to built, with the section; the README's planned line moves to the built clause.
  • Tested and documented: test_timeline_caused.py (runs and approvals by item, the approvals filter, the approval's own line, another reader sees neither, a stranger gets 404, decline from the item; MCP activity_caused and approvals, the assistant); jest timeline-ui.test.tsx (the block, the run link, Approve posting the decision); docs timeline.md (What an item caused), mcp.md, assistant.md, automations.md, requirements.md, changelog.d; make openapi regenerated the client.
  • Open standards: the same Activity Streams 2.0 items; no new dependency.
  • Reported: result goes back in the thread; refine later: Edit and Always allow from the item (the Approvals page has them), Undo on Decline from the item.
  • Reuse: automations.caused, approvals.listing and approval_view, the approvals hook and badge, the automations page's run status and counts helpers, and the existing decide endpoint; no new machinery.

Local CI (ci/local-ci.sh) on this head: running; CI on the PR decides the merge.


Generated by Claude Code

… waiting approvals

An opened item lists the automation runs it started (of the automations the
person manages) and the approvals those runs asked them for, with Approve and
Decline on the ones still waiting, so the pick is made where it was caused;
an approval's own line lists that approval. GET /activities/{id}/caused and
the MCP tool activity_caused read the same for agents, and approvals (API,
MCP, the assistant) takes the activity that caused them.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ln25ykE6uBDqx21WBU94SX
@adeelahmad
adeelahmad merged commit 2461b78 into main Oct 18, 2026
12 checks passed
@adeelahmad
adeelahmad deleted the claude/project-thread-pf8kii branch October 18, 2026 17:13
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

0