feat: add support for Gmail tracking fields#796
feat: add support for Gmail tracking fields#796RaoufGhrissi wants to merge 1 commit intoActivityWatch:masterfrom
Conversation
ActivityWatch is used in timesheet tracking, and knowing just "reading" or "composing" email info is not very useful on its own. Extracting involved email metadata (Sender, Recipients, Subject) helps determine the context of the activity relative to project models and workflows in the used software. A new setting has been added to allow users to enable or disable Gmail tracking. Also added a build.sh script to simplify the build and test process for Chrome and Firefox. ui related changes: ActivityWatch/aw-webui#796
Greptile SummaryThis PR adds support for Gmail tracking fields (
Confidence Score: 4/5This PR is safe to merge; changes are narrow in scope, properly sanitized, and the two flagged issues are low-severity style/robustness concerns rather than runtime bugs. All user-controlled data passes through DOMPurify sanitization. The two comments (missing Array.isArray on
Important Files Changed
Sequence DiagramsequenceDiagram
participant W as Gmail Watcher (aw-watcher-web)
participant S as ActivityWatch Server
participant UI as aw-webui
participant TT as tooltip.js
participant EE as EventEditor.vue
participant EL as EventList.vue
W->>S: POST event {gmail_activity, from, to[], cc[], bcc[], subject}
S->>UI: Events fetched via API
UI->>TT: buildTooltip(bucket, event)
Note over TT: from → plain string (no Array guard)
Note over TT: to/cc/bcc → Array.isArray() guarded
TT-->>UI: Sanitized HTML tooltip string
UI->>EL: events prop passed
Note over EL: (events || []) guards undefined prop
UI->>EE: event prop on Edit click
Note over EE: Array fields bind :value to event.data[k]
Note over EE: Other fields bind v-model to editedEvent.data[k]
Reviews (1): Last reviewed commit: "feat: add support for Gmail tracking fie..." | Re-trigger Greptile |
| b-checkbox(v-if="typeof event.data[k] === typeof true", v-model="editedEvent.data[k]", style="margin: 0.25em") | ||
| b-input(v-if="typeof event.data[k] === typeof 'string'", v-model="editedEvent.data[k]", size="sm") | ||
| b-input(v-if="typeof event.data[k] === 'number'", v-model.number="editedEvent.data[k]", size="sm", type="number") | ||
| b-input(v-if="Array.isArray(event.data[k])", :value="event.data[k].join(', ')", size="sm", disabled) |
There was a problem hiding this comment.
Inconsistent prop binding for array field value
The new array input binds :value to event.data[k].join(', ') — the original component prop — while every other field type in this table uses editedEvent.data[k] (the locally fetched/edited copy). Although this has no visible effect while the field is disabled, it's inconsistent and would silently show stale data if the field ever becomes editable, or if event and editedEvent ever diverge.
| b-input(v-if="Array.isArray(event.data[k])", :value="event.data[k].join(', ')", size="sm", disabled) | |
| b-input(v-if="Array.isArray(event.data[k])", :value="editedEvent.data[k].join(', ')", size="sm", disabled) |
| if (e.data.from) | ||
| inner += `<tr><th>From</th><td>${sanitize(e.data.from)}</td></tr>`; |
There was a problem hiding this comment.
Missing
Array.isArray guard on from field
The to, cc, and bcc fields all defensively handle both array and string via Array.isArray(), but from is always treated as a plain string. Some email APIs do represent multiple senders as an array — if e.data.from ever arrives as an array, it would render as [object Array] in the tooltip rather than a readable email address.
For consistency with the other address fields:
| if (e.data.from) | |
| inner += `<tr><th>From</th><td>${sanitize(e.data.from)}</td></tr>`; | |
| if (e.data.from) | |
| inner += `<tr><th>From</th><td>${sanitize( | |
| Array.isArray(e.data.from) ? e.data.from.join(', ') : e.data.from | |
| )}</td></tr>`; |
ActivityWatch is used in timesheet tracking, and knowing just "reading" or "composing" email info is not very useful on its own. Extracting involved email metadata (Sender, Recipients, Subject) helps determine the context of the activity relative to project models and workflows in the used software. A new setting has been added to allow users to enable or disable Gmail tracking. Also added a build.sh script to simplify the build and test process for Chrome and Firefox. ui related changes: ActivityWatch/aw-webui#796
ActivityWatch is used in timesheet tracking, and knowing just "reading" or "composing" email info is not very useful on its own. Extracting involved email metadata (Sender, Recipients, Subject) helps determine the context of the activity relative to project models and workflows in the used software. A new setting has been added to allow users to enable or disable Gmail tracking. Also added a build.sh script to simplify the build and test process for Chrome and Firefox. ui related changes: ActivityWatch/aw-webui#796
ActivityWatch is used in timesheet tracking, and knowing just "reading" or "composing" email info is not very useful on its own. Extracting involved email metadata (Sender, Recipients, Subject) helps determine the context of the activity relative to project models and workflows in the used software. A new setting has been added to allow users to enable or disable Gmail tracking. Also added a build.sh script to simplify the build and test process for Chrome and Firefox. ui related changes: ActivityWatch/aw-webui#796
ActivityWatch is used in timesheet tracking, and knowing just "reading" or "composing" email info is not very useful on its own. Extracting involved email metadata (Sender, Recipients, Subject) helps determine the context of the activity relative to project models and workflows in the used software. A new setting has been added to allow users to enable or disable Gmail tracking. Also added a build.sh script to simplify the build and test process for Chrome and Firefox. ui related changes: ActivityWatch/aw-webui#796
ActivityWatch is used in timesheet tracking, and knowing just "reading" or "composing" email info is not very useful on its own. Extracting involved email metadata (Sender, Recipients, Subject) helps determine the context of the activity relative to project models and workflows in the used software. A new setting has been added to allow users to enable or disable Gmail tracking. Also added a build.sh script to simplify the build and test process for Chrome and Firefox. ui related changes: ActivityWatch/aw-webui#796
ActivityWatch is used in timesheet tracking, and knowing just "reading" or "composing" email info is not very useful on its own. Extracting involved email metadata (Sender, Recipients, Subject) helps determine the context of the activity relative to project models and workflows in the used software. A new setting has been added to allow users to enable or disable Gmail tracking. Also added a build.sh script to simplify the build and test process for Chrome and Firefox. ui related changes: ActivityWatch/aw-webui#796
ActivityWatch is used in timesheet tracking, and knowing just "reading" or "composing" email info is not very useful on its own. Extracting involved email metadata (Sender, Recipients, Subject) helps determine the context of the activity relative to project models and workflows in the used software. A new setting has been added to allow users to enable or disable Gmail tracking. Also added a build.sh script to simplify the build and test process for Chrome and Firefox. ui related changes: ActivityWatch/aw-webui#796
Dependent on: ActivityWatch/aw-watcher-web#218