Skip to content
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

feat: initial implementation of session time counter extension #16

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

batunpc
Copy link

@batunpc batunpc commented Dec 10, 2022

Resolves #11

I have added the initial implementation to measure active window time for current session for the user. You can investigate extensions/session-time-counter/src/extension.ts to see my implementation.

During the process I had such questions like;

  • What could be the conditions to measure active window time?
  • If the number of characters deleted should also be counted as written? (can be an follow up issue)

As we build this extension maybe we need to clarify these crucial questions and file corresponding issues to help with the development process.

Let me know what you think 🤩

@batunpc batunpc changed the title frat: initial implementation of session time counter extension feat: initial implementation of session time counter extension Dec 10, 2022
Copy link
Contributor

@humphd humphd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking like a good start. Question: why put it in extensions/*? This entire thing is one extension.

@@ -0,0 +1,20 @@
/**@type {import('eslint').Linter.Config} */
// eslint-disable-next-line no-undef
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this needed? Seems odd in the eslint config itself.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While I was working on this PR, I have used their official vscode repo as a source on how to do this. They have nice documentation and samples.

This particular lines in eslint config were from the base files of their hello world sample in here.


const interval = setInterval(() => {
updateSesstionTime();
currentSessionTimeItem.text = (sessionTime / 1000).toFixed(0) + " seconds";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's use https://www.npmjs.com/package/ms to do this

@batunpc batunpc marked this pull request as draft December 16, 2022 09:16
@batunpc
Copy link
Author

batunpc commented Dec 16, 2022

I saw the official vscode repo to put some extensions in extensions folder. I am not sure what could be a good design but maybe having single node_modules makes sense as I am having trouble with failing tests. I am not sure where I should put the extension.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feat: provide screen stats
2 participants