Skip to content

fix: pass bucket ID correctly for event editing in timeline views#765

Merged
ErikBjare merged 1 commit intoActivityWatch:masterfrom
TimeToBuildBob:fix/event-edit-bucket-id
Feb 22, 2026
Merged

fix: pass bucket ID correctly for event editing in timeline views#765
ErikBjare merged 1 commit intoActivityWatch:masterfrom
TimeToBuildBob:fix/event-edit-bucket-id

Conversation

@TimeToBuildBob
Copy link
Contributor

@TimeToBuildBob TimeToBuildBob commented Feb 22, 2026

Summary

Fixes #576 — events couldn't be edited from Raw Data, Search, or Query views because the bucket ID was missing in the API URL.

Root cause: VisTimeline.vue's onSelect handler read the bucket ID from group.content instead of group.id. When showRowLabels=false (Raw Data / Bucket view), content is set to '' to hide labels, producing broken API calls like GET /api/0/buckets//events/{id}.

Fix:

  • Use group.id instead of group.content to get the bucket ID
  • Add guard for placeholder bucket IDs ('search', 'events') and null event IDs from merged query results, preventing doomed 404 requests

Important

Fixes bucket ID retrieval in VisTimeline.vue to prevent broken API calls when editing events in timeline views.

  • Behavior:
    • Fixes bucket ID retrieval in onSelect method of VisTimeline.vue by using group.id instead of group.content.
    • Adds guard clauses to prevent API calls with placeholder bucket IDs ('search', 'events') or null event IDs.
  • Misc:
    • Logs a message when skipping event editing due to invalid IDs.

This description was created by Ellipsis for c696b50. You can customize this summary. It will automatically update as commits are pushed.

…okup

When showRowLabels=false (e.g. in the Raw Data bucket view), group.content
is set to '' to hide row labels, causing onSelect to resolve an empty bucket
ID and producing broken API calls like:
  GET /api/0/buckets//events/{event_id}

Fix by using group.id (always the bucket ID) instead of group.content for
the bucketId lookup.

Also guard against editing events with null ID (merged query results) or
placeholder bucket IDs ('events', 'search') used in Search/Query views,
where no real bucket is available. These cases now return early instead of
making a doomed 404 request.

Fixes ActivityWatch#576
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Important

Looks good to me! 👍

Reviewed everything up to c696b50 in 5 seconds. Click for details.
  • Reviewed 24 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 0 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.

Workflow ID: wflow_DyzcwyI6KwzjPaez

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

@codecov
Copy link

codecov bot commented Feb 22, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 25.67%. Comparing base (934daca) to head (c696b50).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #765   +/-   ##
=======================================
  Coverage   25.67%   25.67%           
=======================================
  Files          30       30           
  Lines        1741     1741           
  Branches      316      311    -5     
=======================================
  Hits          447      447           
+ Misses       1272     1228   -44     
- Partials       22       66   +44     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 22, 2026

Greptile Summary

Fixed event editing from timeline views by correcting bucket ID retrieval. Previously, the code read group.content which becomes an empty string when row labels are hidden (showRowLabels=false), causing broken API calls like GET /api/0/buckets//events/{id}. The fix uses group.id instead, which always contains the actual bucket ID. Added defensive guards to skip editing for events without IDs (e.g., merged query results) and placeholder buckets ('events', 'search').

Changes:

  • Changed bucket ID lookup from group.content to group.id in VisTimeline.vue:187
  • Added validation to prevent editing when event.id is null/undefined
  • Added validation to skip placeholder bucket IDs that don't correspond to real buckets
  • Added console logging for debugging when editing is skipped

Confidence Score: 5/5

  • Safe to merge - this is a targeted bug fix with defensive guards
  • The fix correctly addresses the root cause by using group.id instead of group.content. The code analysis shows groups are constructed with id always containing the bucket ID while content can be empty. The additional guards prevent edge cases with invalid IDs. The change is minimal, focused, and improves robustness without breaking existing functionality.
  • No files require special attention

Important Files Changed

Filename Overview
src/visualizations/VisTimeline.vue Fixed bucket ID retrieval bug by using group.id instead of group.content, and added guards for invalid event/bucket IDs

Last reviewed commit: c696b50

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

1 file reviewed, no comments

Edit Code Review Agent Settings | Greptile

@TimeToBuildBob
Copy link
Contributor Author

The Test (node-20, py-3.9, aw-server-rust master) check failure is a pre-existing upstream issue — the cleanup step tries to glob ~/.cache/activitywatch/log/*/*.log but aw-server-rust master doesn't write logs to that path. All actual test steps (unit tests, e2e) pass. Unrelated to this PR's changes.

@ErikBjare ErikBjare merged commit 0c0368c into ActivityWatch:master Feb 22, 2026
7 of 8 checks passed
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.

Can't edit events in Raw Data/Search/Query

2 participants