Skip to content

Feature: allow custom category per URL pattern #303

@pedropombeiro

Description

@pedropombeiro

Problem

The extension currently supports custom project names per URL pattern (via the settings page), but there is no way to set a custom category for URL patterns.

For example, mail.google.com is not recognized by any built-in site parser, so heartbeats from Gmail are sent without a category. Users who want to track time spent on email as communicating (similar to how Slack is categorized) have no way to do so.

Proposal

Extend the existing Custom Project Names feature to also support an optional category field. The settings UI already has a table of URL regex → project name mappings. Adding a category dropdown (with values like coding, communicating, designing, browsing, debugging, building, running tests, etc.) to each row would allow users to categorize any website.

Implementation sketch

In WakaTimeCore.ts, buildHeartbeat() currently resolves the project name from customProjectNames:

const projectNameFromList = this.getProjectNameFromList(url, settings);

A similar lookup could resolve a custom category:

const customSite = this.getCustomSiteConfig(url, settings);
// ...
project: customSite?.projectName ?? heartbeat?.project ?? '<<LAST_PROJECT>>',
category: customSite?.category ?? heartbeat?.category,

Use cases

  • Gmail (mail.google.com) → category: communicating
  • Google Calendar (calendar.google.com) → category: communicating
  • Jira / Linear / GitLab Issues → category: coding or a custom project name
  • Google Docs used for design specs → category: designing

Prior art

  • Issue Using custom rules to categorize chrome ext #38 requested custom categorization rules and was closed without implementation.
  • The macos-wakatime app already sets categories per app (e.g. Slack → communicating, Figma → designing).
  • The customProjectNames feature in this extension already demonstrates the pattern of per-URL custom overrides.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions