Skip to content

Support editor-bucket-aware categorization for editor project/workspace rules #1305

@TimeToBuildBob

Description

@TimeToBuildBob

Problem

aw-webui category queries currently run through canonicalEvents(...), which builds categorized activity from current-window + browser + stopwatch events.

Editor activity buckets (app.editor.activity) are queried separately via editorActivityQuery(...) and are only used for editor visualizations (top_files, top_languages, top_projects). They are not part of the categorization pipeline today.

That means requests like "match this category by editor project/workspace" cannot work yet, even if the UI grows a field selector, because the project data never reaches the events being categorized.

User-facing example: activity-watch-mode / Emacs reports project data, but a category rule cannot currently match on it. See ActivityWatch/aw-webui#619.

Current State

  • aw-webui/src/queries.ts::canonicalEvents(...) categorizes canonical window/browser/stopwatch events
  • aw-webui/src/queries.ts::editorActivityQuery(...) fetches editor buckets separately
  • Editor bucket fields such as project are therefore unavailable to normal category reports, timelines, and aggregates

Design Questions

  1. Should category queries consume editor buckets directly?
  2. Or should editor-derived fields be merged/projection-attached onto canonical window events before categorization?
  3. How should overlap/conflicts between window activity and editor activity be handled?
  4. Which editor fields should be treated as stable/canonical across watchers (project, file, language, etc.)?

Acceptance Criteria

  • A user can define a category rule that matches editor project/workspace data.
  • The resulting category appears in normal category views/reports, not only editor-specific visualizations.
  • The approach is documented clearly enough that watcher implementations know which fields they need to provide.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions