Update taxmaro-tracking extension - #30479
Conversation
- chore: use npm - chore: initial commit
- fix: remove colleague id requirerment - chore: update readme
|
Congratulations on your new Raycast extension! 🚀 We're currently experiencing a high volume of incoming requests. As a result, the initial review may take up to 15 business days. Once the PR is approved and merged, the extension will be available on our Store. |
Greptile SummaryThis PR adds a new Taxmaro time-tracking extension with no-view and menu-bar commands backed by a shared API client and persistent status cache.
Confidence Score: 3/5The PR is not safe to merge until previous-day cache handling and cross-command toggle races are fixed. Persistent status can be rendered as today's time after a date rollover, and independent command instances can race through shared optimistic state and send conflicting tracking actions; the remaining findings concern repository-required preference typing, locale handling, and changelog coverage. Files Needing Attention: extensions/taxmaro-tracking/src/status-cache.ts, extensions/taxmaro-tracking/src/tracking-status.ts, extensions/taxmaro-tracking/src/toggle-tracking.ts, extensions/taxmaro-tracking/src/menu-bar.tsx, extensions/taxmaro-tracking/src/taxmaro.ts, extensions/taxmaro-tracking/package.json Important Files Changed
Prompt To Fix All With AI### Issue 1
extensions/taxmaro-tracking/src/status-cache.ts:12
**Stale cache crosses day boundaries**
When the menu bar starts after midnight with a previous-day cache entry, `readCachedStatus` returns yesterday’s closed duration and running timestamp as initial data, causing the UI to report yesterday’s time—and potentially overnight elapsed time—as today’s total until a refresh succeeds.
### Issue 2
extensions/taxmaro-tracking/src/toggle-tracking.ts:15-19
**Shared toggle state can race**
If the no-view and menu-bar commands overlap, each independently inverts shared optimistic state and performs a non-atomic status-check-then-POST sequence, causing conflicting start/stop requests whose final server state can contradict the user’s action and displayed feedback.
### Issue 3
extensions/taxmaro-tracking/src/taxmaro.ts:9-13
**Preference type duplicates manifest**
The manually maintained `TaxmaroPreferences` interface duplicates Raycast’s generated preference type, allowing the manifest and source definitions to drift and bypassing the generated compile-time contract.
```suggestion
const preferences = getPreferenceValues<Preferences>();
```
### Issue 4
extensions/taxmaro-tracking/src/tracking-status.ts:48
**Formatting follows system locale**
Reading the host locale makes duration formatting vary implicitly between machines despite Raycast’s US-English product surface; use a fixed supported locale or an explicit preference instead.
```suggestion
const locale = "en-US";
```
### Issue 5
extensions/taxmaro-tracking/package.json:1
**Extension omits required changelog**
This new extension package does not include the required `CHANGELOG.md`, leaving its initial release without the repository’s expected version-history entry.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Reviews (1): Last reviewed commit: "Update taxmaro-tracking extension" | Re-trigger Greptile |
| encode: (value) => JSON.stringify(value), | ||
| }); | ||
|
|
||
| export const readCachedStatus = (): TrackingStatus | undefined => { |
There was a problem hiding this comment.
Stale cache crosses day boundaries
When the menu bar starts after midnight with a previous-day cache entry, readCachedStatus returns yesterday’s closed duration and running timestamp as initial data, causing the UI to report yesterday’s time—and potentially overnight elapsed time—as today’s total until a refresh succeeds.
Knowledge Base Used: Extension command implementation patterns
Prompt To Fix With AI
This is a comment left during a code review.
Path: extensions/taxmaro-tracking/src/status-cache.ts
Line: 12
Comment:
**Stale cache crosses day boundaries**
When the menu bar starts after midnight with a previous-day cache entry, `readCachedStatus` returns yesterday’s closed duration and running timestamp as initial data, causing the UI to report yesterday’s time—and potentially overnight elapsed time—as today’s total until a refresh succeeds.
**Knowledge Base Used:** [Extension command implementation patterns](https://app.greptile.com/raycast/-/custom-context/knowledge-base/raycast/extensions/-/docs/extension-command-implementation.md)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.| const previous = readCachedStatus() ?? (await fetchTrackingStatus()); | ||
| const desiredRunning = !previous.running; | ||
| const optimistic = optimisticallySetRunning(previous, desiredRunning); | ||
|
|
||
| writeCachedStatus(optimistic); |
There was a problem hiding this comment.
If the no-view and menu-bar commands overlap, each independently inverts shared optimistic state and performs a non-atomic status-check-then-POST sequence, causing conflicting start/stop requests whose final server state can contradict the user’s action and displayed feedback.
Knowledge Base Used: Extension command implementation patterns
Prompt To Fix With AI
This is a comment left during a code review.
Path: extensions/taxmaro-tracking/src/toggle-tracking.ts
Line: 15-19
Comment:
**Shared toggle state can race**
If the no-view and menu-bar commands overlap, each independently inverts shared optimistic state and performs a non-atomic status-check-then-POST sequence, causing conflicting start/stop requests whose final server state can contradict the user’s action and displayed feedback.
**Knowledge Base Used:** [Extension command implementation patterns](https://app.greptile.com/raycast/-/custom-context/knowledge-base/raycast/extensions/-/docs/extension-command-implementation.md)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.| interface TaxmaroPreferences { | ||
| apiToken: string; | ||
| } | ||
|
|
||
| const preferences = getPreferenceValues<TaxmaroPreferences>(); |
There was a problem hiding this comment.
Preference type duplicates manifest
The manually maintained TaxmaroPreferences interface duplicates Raycast’s generated preference type, allowing the manifest and source definitions to drift and bypassing the generated compile-time contract.
| interface TaxmaroPreferences { | |
| apiToken: string; | |
| } | |
| const preferences = getPreferenceValues<TaxmaroPreferences>(); | |
| const preferences = getPreferenceValues<Preferences>(); |
Rule Used: What: Don't manually define Preferences for `get... (source)
Prompt To Fix With AI
This is a comment left during a code review.
Path: extensions/taxmaro-tracking/src/taxmaro.ts
Line: 9-13
Comment:
**Preference type duplicates manifest**
The manually maintained `TaxmaroPreferences` interface duplicates Raycast’s generated preference type, allowing the manifest and source definitions to drift and bypassing the generated compile-time contract.
```suggestion
const preferences = getPreferenceValues<Preferences>();
```
**Rule Used:** What: Don't manually define `Preferences` for `get... ([source](https://app.greptile.com/raycast/-/custom-context?memory=d93fc9fb-a45d-4479-a6a4-b1b4af98ebc8))
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
| }; | ||
| }; | ||
|
|
||
| const locale = Intl.DateTimeFormat().resolvedOptions().locale; |
There was a problem hiding this comment.
Formatting follows system locale
Reading the host locale makes duration formatting vary implicitly between machines despite Raycast’s US-English product surface; use a fixed supported locale or an explicit preference instead.
| const locale = Intl.DateTimeFormat().resolvedOptions().locale; | |
| const locale = "en-US"; |
Rule Used: What: Do not implement custom localization logic i... (source)
Prompt To Fix With AI
This is a comment left during a code review.
Path: extensions/taxmaro-tracking/src/tracking-status.ts
Line: 48
Comment:
**Formatting follows system locale**
Reading the host locale makes duration formatting vary implicitly between machines despite Raycast’s US-English product surface; use a fixed supported locale or an explicit preference instead.
```suggestion
const locale = "en-US";
```
**Rule Used:** What: Do not implement custom localization logic i... ([source](https://app.greptile.com/raycast/-/custom-context?memory=78677f74-64f7-483b-b90d-9c33e2e049da))
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
| @@ -0,0 +1,64 @@ | |||
| { | |||
There was a problem hiding this comment.
Extension omits required changelog
This new extension package does not include the required CHANGELOG.md, leaving its initial release without the repository’s expected version-history entry.
Rule Used: What: Ensure that CHANGELOG.md is created or updat... (source)
Prompt To Fix With AI
This is a comment left during a code review.
Path: extensions/taxmaro-tracking/package.json
Line: 1
Comment:
**Extension omits required changelog**
This new extension package does not include the required `CHANGELOG.md`, leaving its initial release without the repository’s expected version-history entry.
**Rule Used:** What: Ensure that CHANGELOG.md is created or updat... ([source](https://app.greptile.com/raycast/github/raycast/extensions/-/custom-context?memory=97cd51bc-963b-43f5-acc3-9ba85fe7bb2d))
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
Description
Shortcuts for work time tracking on the Taxmaro platform.
Screencast
Checklist
npm run buildand tested this distribution build in Raycastassetsfolder are used by the extension itselfREADMEare placed outside of themetadatafolder