Skip to content

feat: Implement flexible time display modes for activity status and a…#410

Open
danbenba wants to merge 1 commit intonarcisbugeag:mainfrom
danbenba:main
Open

feat: Implement flexible time display modes for activity status and a…#410
danbenba wants to merge 1 commit intonarcisbugeag:mainfrom
danbenba:main

Conversation

@danbenba
Copy link

@danbenba danbenba commented Jan 6, 2026

This Pull Request adds more flexibility to the elapsed time display in Discord Rich Presence. It introduces new display modes and adds technical documentation to facilitate future contributions.

Main Changes

  1. New Time Modes (vscord.status.time.mode):
    • Hidden: Completely hides the timestamp.
    • Elapsed: Shows the time elapsed since the start of the activity (standard behavior).
    • Current Interface: Shows the elapsed time since the beginning of the day (effectively displaying local time).
    • Custom: Allows setting a specific timestamp to count from.
    • Fixed: Shows a static timer (00:00).
  2. Deprecation of Old Setting:
    • vscord.status.showElapsedTime is now marked as deprecated in favor of the new, more comprehensive mode system.
  3. Developer Documentation:
    • Added a src/README.md file explaining how to set up the environment, compile, and run the extension in development mode.

Technical Modifications

  • Updated package.json with new configurations and descriptions.
  • Updated the time calculation logic in src/activity.ts.
  • Added configuration keys in src/constants.ts and updated types in src/config.ts.

Why these changes?

Users have requested more control over how time is displayed. The "Current Interface" mode provides a more natural way to show the current time, while the "Custom" and "Fixed" modes offer advanced personalization for specific needs.

Copy link
Collaborator

@nick22985 nick22985 left a comment

Choose a reason for hiding this comment

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

Hey,
Thank you for your pull request however their are a few issues with it.

I also cant get this working at all the timestamp just stays the same always. It none of the enum multi selects seem to change the logic.

Comment on lines +126 to +129
case "Fixed":
delete presence.startTimestamp;
delete presence.endTimestamp;
break;
Copy link
Collaborator

Choose a reason for hiding this comment

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

this does the same thing as "hidden"

Copy link
Collaborator

Choose a reason for hiding this comment

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

this file should be deleted it serves no purpose

@@ -185,7 +185,33 @@
"vscord.status.showElapsedTime": {
Copy link
Collaborator

Choose a reason for hiding this comment

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

this field is still used throughout the code base and is not deprecated. It is also used in your switch case block you made here: https://github.com/narcisbugeag/vscord/pull/410/changes#diff-25b8815d592fb665b70c36526091c1dfc73d09988d9199d21c228f825a1a1a75R109

Comment on lines +108 to +122
case "Elapsed":
if (config.get(CONFIG_KEYS.Status.ShowElapsedTime)) {
presence.startTimestamp = config.get(CONFIG_KEYS.Status.ResetElapsedTimePerFile)
? Date.now()
: (previous.startTimestamp ?? Date.now());
} else {
delete presence.startTimestamp;
}
break;
case "Current Interface": {
const now = new Date();
const midnight = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 0, 0, 0, 0);
presence.startTimestamp = midnight.getTime();
break;
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

this is also duplicated from the default statement. Should just be the same code path in the switch

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.

2 participants