8000 feat(timeline): For you counts the items you open by adeelahmad · Pull Request #665 · adeelahmad/lense · GitHub
[go: up one dir, main page]

Skip to content

feat(timeline): For you counts the items you open - #665

Merged
adeelahmad merged 1 commit into
mainfrom
claude/project-thread-pf8kii
Oct 19, 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: For you learned only from reactions, comments and important or hidden marks, so someone who reads a lot but rarely reacts got a For you order no different from Latest.

After: opening an item counts too. Following a timeline line to what it is about (the title, the Open button, an item inside a group) or opening an item by its address (/timeline?item=) sends POST /api/v1/activities/{id}/open, and each open adds +½ (up to four opens of one item) to the person's own affinity for its source, kind and entities.

How: for_you.opened upserts event_open:<hash of account and activity> with a count; for_you.signals reads the most recent 200 as one more signal. The rows go when the person is removed and with the hourly tidy (#662) when the activity is gone. The page calls it fire-and-forget through a useOpened hook.

Motivation and Context

A refine-later item of the activity stream design: "For you counts opens too, once the page reports them."

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-for-you-opens.md).

Done questions (AGENTS.md)

  • Goal: For you learns from reading, not only reacting; merged on green CI.
  • Agents: the open is a plain API call any client can make; agents read For you as before.
  • Zero setup: works on its own.
  • Fewest clicks: no new click; opening is counted as it happens.
  • Configurable: n/a, no new setting; Latest stays the default order.
  • Light: one small upsert per open; no model call.
  • Private and secure: counts are the person's own, used only in their own order; only items they can see (404 otherwise); removed with them.
  • Cost: no model call.
  • User decides: Latest stays the default; nothing anyone else sees changes.
  • Upgrades: a new table defined with IF NOT EXISTS; nothing existing changes shape.
  • Honest: docs/timeline.md lists opens with their weight and cap.
  • Tested and documented: pytest test_opening_an_item_counts_for_you_a_little_each_time_up_to_a_few; jest in the address can name one item…; docs, database.md, requirements.md, changelog.d; client regenerated with make openapi.
  • Open standards: n/a.
  • Reported: result goes back in the thread; refine later: cache affinity for a minute.
  • Reuse: for_you.signals, the event_marks tidy, the generated client.

CI on the PR decides the merge.


Generated by Claude Code

Following a line to what it is about, or opening an item by its address,
sends POST /activities/{id}/open; each open adds a small weight (up to four
per item) to the person's own For you affinity. Counts live in event_open,
removed with the person and tidied with the marks when the activity is gone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ln25ykE6uBDqx21WBU94SX
@adeelahmad
adeelahmad merged commit 73d9e35 into main Oct 19, 2026
12 checks passed
@adeelahmad
adeelahmad deleted the claude/project-thread-pf8kii branch October 19, 2026 04:12
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