-
Notifications
You must be signed in to change notification settings - Fork 30.9k
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
Provide a way to add a timestamp to a comment #139524
Comments
FYI @laurentlb, I'm planning to start work on this soon. |
To get a UX consistent with GitHub, I think we'll need two fields:
|
I just discussed another idea with @laurentlb:
This seems the most flexible with regards to to tailoring an extension (e.g. "our company is in these three timezones, which should be available from the tooltip") as well as allowing a user to easily configure this (e.g. "I want this exact format string for long dates" or "I never want relative dates"), in the settings of an extension, or the settings of core VS Code itself (for the default formatting when no formatter was registered). edit: For responsive relative dates (specifically "X mins ago"), the formatter would probably also need a way to influence when it is called again for the timestamp of a particular comment. Coming from RXJS, this seems like a fitting place to return an observable—all updates owned by the formatter—but this is not something I have encountered in VS Code code so far. An alternative with more manual house-keeping necessary on the VS Code side would be including another field in the object returned for a formatted date, which indicates when it will go stale. This could be an enum for more constraints from VS Code, e.g. "call me roughly every minute" vs "call me roughly every hour". Alternatively, just a |
Current proposal: vscode/src/vscode-dts/vscode.proposed.commentTimestamp.d.ts Lines 6 to 14 in 96189e4
|
Note from early discussions: We usually leave display decisions up to the users. Instead of having |
For flexibility, we're now looking at using vscode/src/vscode-dts/vscode.proposed.commentTimestamp.d.ts Lines 7 to 9 in 7e586e7
To align with the timeline API proposal, should |
After further discussing, we are keeping vscode/src/vscode-dts/vscode.proposed.commentTimestamp.d.ts Lines 7 to 14 in b978d71
Whether relative or precise time is used for display is controlled by the setting I have not tested other locales, but VS Code should handle displaying And finally, I didn't add anything to update the relative time yet. It will be updated every time the comment is rendered, so switching files will cause it to update. If this doesn't feel responsive enough then we can add some periodic updating. @laurentlb and @hermannloose please let me know what you think of this proposal. |
That's great, thanks! |
I had to revert the change in main due to a loading issue. Will comment again when it's back. |
API proposal is back in main today. |
@alexr00 maybe allow a bit more characters before truncate. |
@isidorn that's exactly how it works :) I will make the length before truncate longer. |
Thanks for screenshot, and the progress on this issue! |
@albertelo @alexr00 and me discussed this, and we thought that showing a comment "snippet" would be the best to make this view function as a good "bird's eye perspective" of what is going on. Problem with making it multi line is that it adds visual complexity - especially if there is a parent child comment relationship. |
At a high level what we found from our users was some trouble distinguishing the information that is shown. Username, time stamp and comment look similar and discerning that info might be hard. Adding a single node for the comment could help, and it would be done without having to add additional visual elements (e.g. username profile image or icons). That said, I recognize that if you have many nodes then the information density increases and so does the visual complexity. |
@albertelo thanks for feedback. I agree that your proposed design in the first screen shot reduces visual complexity since it does not show comment snippets. However then the items would look too similar and it would be hard for the user to discern which item in the comments view to click on - especially in the case when all the comments are from the same team mate. This seems to align with what you heard from your users. Can you maybe provide a sketch for how the single node comment idea would look? How would that work if there are replies which are already tree children? |
The proposal keeps getting smaller: vscode/src/vscode-dts/vscode.proposed.commentTimestamp.d.ts Lines 7 to 13 in 8b27820
Moved away from detail and now we're all in on calling it a timestamp that can only be a date. |
@laurentlb Thanks for the sketch. I personally like the idea of showing the snippet of the latest comment in the thread. Maybe we should have some simple However I think it is worth trying out both approaches and @alexr00 and me will consider these ideas and once we try them out we will know more. Thanks! |
@laurentlb @albertelo please try it out with VS Code insiders from tomorrow and let us know what you think. We are looking forward to the feedback. Thanks! |
Great - thanks for letting us know. Adding verified label. |
Example of where this could be used: microsoft/vscode-pull-request-github#121
Some ideas for how this could look:
The text was updated successfully, but these errors were encountered: