-
Notifications
You must be signed in to change notification settings - Fork 13
Feature:previous periods + first day of the week configuration #50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
correct run-name in repository statistics workflow add push trigger for action/repo-stats branch in repository statistics workflow refactor: move permissions section to top and update token reference in repo-stats workflow fix: update run-name formatting and remove push trigger from repository statistics workflow
add repository statistics workflow for automated metrics collection
… version handling
This allows `npm test` to execute eslint.
* feat: add branch tracking and view storage data command * feat: add documentation for time tracking mechanism and todo list * feat: enhance branch tracking * feat: add project-specific branch filtering and update UI for branch selection * feat: add command to clear all time tracking data with confirmation prompt * feat: enhance project and branch tracking in documentation and update usage instructions * Update package.json
… enhancing source checkout
…ng output messages
This commit allows a user to set what day is the start of the week. The user now can select what day is the week start day in the configuration.
This commit adds the information about the previous periods, namely, last week, last month and last year. It also optimizes the calculation of time by iterating over TimeEntries only once.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR enhances the extension by adding Git branch–aware tracking, configurable week start, and reporting for previous periods, along with data‐management commands.
- Track and save coding sessions per Git branch and compute totals for yesterday, last week/month/year.
- Add
weekStartDay
configuration and update summary UI with branch filters. - Register new commands for viewing and clearing stored data and update status bar to include branch info.
Reviewed Changes
Copilot reviewed 13 out of 26 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
src/timeTracker.ts | Introduce Git watcher, branch tracking, weekStartDay , and getAllPeriodTotals |
src/summaryView.ts | Extend search, UI, and message payload to support branch filtering |
src/statusBar.ts | Switch to getAllPeriodTotals , display current branch in tooltip |
src/extension.ts | Add viewStorageData & clearAllData commands |
src/database.ts | Migrate existing entries, add branch field, branch summary & filtering |
package.json | Bump version, add weekStartDay setting and adjust saveInterval default |
README.md | Update features and config section to reflect branch tracking and new defaults |
Comments suppressed due to low confidence (5)
package.json:64
- [nitpick] The command ID uses a different prefix (
coding-time-tracker
) than the rest (simpleCodingTimeTracker
). Rename tosimpleCodingTimeTracker.clearAllData
for consistency.
"command": "coding-time-tracker.clearAllData",
src/statusBar.ts:1
- The
StatusBar
class implementsDisposable
but lacks adispose()
method to clear the interval and hide the status bar item. Add adispose()
that callsclearInterval(this.updateInterval)
andthis.statusBarItem.dispose()
.
import * as vscode from 'vscode';
src/timeTracker.ts:271
- The new
getAllPeriodTotals
method has complex date logic and branch inclusion. Consider adding unit tests to verify period boundaries and branch filtering.
async getAllPeriodTotals(): Promise<{
README.md:57
- The default
saveInterval
was changed to 30 seconds inpackage.json
. Update the README to reflect the new default.
- Default: 5 seconds
src/timeTracker.ts:231
- The external-file handling logic was removed, so files outside the workspace now fall back to the first folder name. Restore logic to detect
External/...
for out-of-workspace files.
if (workspaceFolders.length === 1) {
this.panel.reveal(); | ||
this.panel.webview.html = this.getHtmlForWebview(projects); | ||
this.panel.webview.postMessage({ command: 'update', data: summaryData, projects: projects, totalTime: totalTime }); | ||
this.panel.webview.postMessage({ command: 'update', data: summaryData, projects, totalTime, configData }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The panel update message omits the branches
property, so the branch dropdown won't populate when using the panel. Include branches
in the payload like the webview view.
this.panel.webview.postMessage({ command: 'update', data: summaryData, projects, totalTime, configData }); | |
this.panel.webview.postMessage({ command: 'update', data: summaryData, projects, branches, totalTime, configData }); |
Copilot uses AI. Check for mistakes.
if (!this.isTracking) { | ||
this.startTracking(); | ||
await this.startTracking(); | ||
} | ||
|
||
// Update the last activity timestamp | ||
this.lastCursorActivity = Date.now(); | ||
|
||
// Reset and setup the inactivity timer | ||
this.setupCursorTracking(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] This async method is called from event callbacks without awaiting or catching errors. Consider catching rejections or removing async
if not needed to avoid unhandled promise rejections.
Copilot uses AI. Check for mistakes.
This pull request adds functionality of getting the data about the previous periods.
It also adds configuration of the first day of the week (it was before in a separate PR, however, I decided to combine them).
In this pull request, I've deleted the information about when the periods start because this makes the code more complicated (especially, if you want to add the same format for all types of periods).
Closes #36