Skip to content

SCM - consistently render date on the right in the repositories view#280870

Merged
lszomoru merged 1 commit intomainfrom
lszomoru/scm-repositories-timestamp
Dec 3, 2025
Merged

SCM - consistently render date on the right in the repositories view#280870
lszomoru merged 1 commit intomainfrom
lszomoru/scm-repositories-timestamp

Conversation

@lszomoru
Copy link
Member

@lszomoru lszomoru commented Dec 3, 2025

Fixes #280608

Copilot AI review requested due to automatic review settings December 3, 2025 06:50
@lszomoru lszomoru enabled auto-merge (squash) December 3, 2025 06:50
@lszomoru lszomoru self-assigned this Dec 3, 2025
@lszomoru lszomoru added the scm General SCM compound issues label Dec 3, 2025
@lszomoru lszomoru added this to the November 2025 milestone Dec 3, 2025
Copy link
Contributor

Copilot AI left a 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 improves the consistency of date rendering in the SCM repositories view by moving timestamps from artifact descriptions to a dedicated right-aligned column. This addresses issue #280608.

Key Changes:

  • Added optional timestamp field to SCM artifact interfaces across API surface and internal implementations
  • Implemented visual timestamp rendering with smart hiding of duplicate timestamps for artifacts in the same folder/group
  • Extracted timestamp logic from Git artifact descriptions to dedicated timestamp field

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/vscode-dts/vscode.proposed.scmArtifactProvider.d.ts Added optional timestamp property to SourceControlArtifact API
src/vs/workbench/contrib/scm/common/artifact.ts Added timestamp to ISCMArtifact and hideTimestamp flag to SCMArtifactTreeElement
src/vs/workbench/contrib/scm/browser/scmRepositoriesViewPane.ts Implemented timestamp rendering with duplicate detection logic for folder-grouped and flat artifact lists
src/vs/workbench/contrib/scm/browser/media/scm.css Added styling for timestamp container with visual treatment for duplicates (vertical line) and hover behavior
src/vs/workbench/api/common/extHost.protocol.ts Added timestamp to SCMArtifactDto interface for extension host protocol
extensions/git/src/artifactProvider.ts Modified to provide timestamp from Git commit dates and removed timestamp from artifact descriptions

Comment on lines +328 to +340
const artifactBasename = artifact.id.lastIndexOf('/') > 0
? artifact.id.substring(0, artifact.id.lastIndexOf('/'))
: artifact.id;

const prevArtifact = index > 0 ? artifacts[index - 1] : undefined;
const prevArtifactBasename = prevArtifact && prevArtifact.id.lastIndexOf('/') > 0
? prevArtifact.id.substring(0, prevArtifact.id.lastIndexOf('/'))
: prevArtifact?.id;

const hideTimestamp = index > 0 &&
artifact.timestamp !== undefined &&
prevArtifact?.timestamp !== undefined &&
artifactBasename === prevArtifactBasename &&
Copy link

Copilot AI Dec 3, 2025

Choose a reason for hiding this comment

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

The variable name artifactBasename is misleading. Based on the logic, this extracts the directory path (everything before the last '/'), not the basename. Consider renaming it to artifactDirectory or artifactDirPath for clarity.

Suggested change
const artifactBasename = artifact.id.lastIndexOf('/') > 0
? artifact.id.substring(0, artifact.id.lastIndexOf('/'))
: artifact.id;
const prevArtifact = index > 0 ? artifacts[index - 1] : undefined;
const prevArtifactBasename = prevArtifact && prevArtifact.id.lastIndexOf('/') > 0
? prevArtifact.id.substring(0, prevArtifact.id.lastIndexOf('/'))
: prevArtifact?.id;
const hideTimestamp = index > 0 &&
artifact.timestamp !== undefined &&
prevArtifact?.timestamp !== undefined &&
artifactBasename === prevArtifactBasename &&
const artifactDirectory = artifact.id.lastIndexOf('/') > 0
? artifact.id.substring(0, artifact.id.lastIndexOf('/'))
: artifact.id;
const prevArtifact = index > 0 ? artifacts[index - 1] : undefined;
const prevArtifactDirectory = prevArtifact && prevArtifact.id.lastIndexOf('/') > 0
? prevArtifact.id.substring(0, prevArtifact.id.lastIndexOf('/'))
: prevArtifact?.id;
const hideTimestamp = index > 0 &&
artifact.timestamp !== undefined &&
prevArtifact?.timestamp !== undefined &&
artifactDirectory === prevArtifactDirectory &&

Copilot uses AI. Check for mistakes.
Comment on lines +328 to +340
const artifactBasename = artifact.id.lastIndexOf('/') > 0
? artifact.id.substring(0, artifact.id.lastIndexOf('/'))
: artifact.id;

const prevArtifact = index > 0 ? artifacts[index - 1] : undefined;
const prevArtifactBasename = prevArtifact && prevArtifact.id.lastIndexOf('/') > 0
? prevArtifact.id.substring(0, prevArtifact.id.lastIndexOf('/'))
: prevArtifact?.id;

const hideTimestamp = index > 0 &&
artifact.timestamp !== undefined &&
prevArtifact?.timestamp !== undefined &&
artifactBasename === prevArtifactBasename &&
Copy link

Copilot AI Dec 3, 2025

Choose a reason for hiding this comment

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

The variable name prevArtifactBasename is misleading. Based on the logic, this extracts the directory path (everything before the last '/'), not the basename. Consider renaming it to prevArtifactDirectory or prevArtifactDirPath for clarity.

Suggested change
const artifactBasename = artifact.id.lastIndexOf('/') > 0
? artifact.id.substring(0, artifact.id.lastIndexOf('/'))
: artifact.id;
const prevArtifact = index > 0 ? artifacts[index - 1] : undefined;
const prevArtifactBasename = prevArtifact && prevArtifact.id.lastIndexOf('/') > 0
? prevArtifact.id.substring(0, prevArtifact.id.lastIndexOf('/'))
: prevArtifact?.id;
const hideTimestamp = index > 0 &&
artifact.timestamp !== undefined &&
prevArtifact?.timestamp !== undefined &&
artifactBasename === prevArtifactBasename &&
const artifactDirectory = artifact.id.lastIndexOf('/') > 0
? artifact.id.substring(0, artifact.id.lastIndexOf('/'))
: artifact.id;
const prevArtifact = index > 0 ? artifacts[index - 1] : undefined;
const prevArtifactDirectory = prevArtifact && prevArtifact.id.lastIndexOf('/') > 0
? prevArtifact.id.substring(0, prevArtifact.id.lastIndexOf('/'))
: prevArtifact?.id;
const hideTimestamp = index > 0 &&
artifact.timestamp !== undefined &&
prevArtifact?.timestamp !== undefined &&
artifactDirectory === prevArtifactDirectory &&

Copilot uses AI. Check for mistakes.
@lszomoru lszomoru merged commit 1027a1a into main Dec 3, 2025
34 of 35 checks passed
@lszomoru lszomoru deleted the lszomoru/scm-repositories-timestamp branch December 3, 2025 07:09
@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Jan 17, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

scm General SCM compound issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SCM Stashes: timestamp should be rendered to the right of the node

3 participants