Skip to content

Preserve user-defined casing for File Explorer workspace titles - #331645

Merged
Lee Murray (mrleemurray) merged 3 commits into
mainfrom
mrleemurray/structural-lavender-angelfish
Aug 19, 2026
Merged

Preserve user-defined casing for File Explorer workspace titles#331645
Lee Murray (mrleemurray) merged 3 commits into
mainfrom
mrleemurray/structural-lavender-angelfish

Conversation

@mrleemurray

@mrleemurray Lee Murray (mrleemurray) commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

This pull request improves how the File Explorer displays workspace names by ensuring that user-provided workspace names are shown with their original casing, rather than being automatically capitalized or uppercased. It introduces new logic and CSS classes to distinguish between user-named workspaces and system-generated or untitled workspaces, updates the Explorer view logic, and adds comprehensive tests to verify the new behavior.

Key changes include:

Explorer View Logic and API

  • Added the shouldPreserveWorkspaceNameCase function to determine if the original casing of a workspace name should be preserved, based on workspace type and configuration. This function is used to apply appropriate styling only to user-named workspaces. (src/vs/workbench/contrib/files/browser/views/explorerView.ts)
  • Introduced new CSS class constants PRESERVE_WORKSPACE_NAME_CASE_CLASS and PRESERVE_MERGED_WORKSPACE_NAME_CASE_CLASS for marking DOM elements that should preserve name casing. (src/vs/workbench/contrib/files/browser/views/explorerView.ts)
  • Updated the ExplorerView class to manage and update these classes on the relevant DOM nodes when the workspace changes, the view is shown/hidden, or the header visibility changes. (src/vs/workbench/contrib/files/browser/views/explorerView.ts) [1] [2] [3] [4] [5]

Styling

  • Updated the Modern UI CSS so that only DOM elements with the new classes (preserve-workspace-name-case or preserve-merged-workspace-name-case) will display workspace names with their original casing. Untitled and system-generated names continue to use standard capitalization. (src/vs/workbench/contrib/modernUI/browser/media/fontRamp.css)

Testing

  • Added a unit test for shouldPreserveWorkspaceNameCase to ensure it correctly identifies when to preserve the workspace name's casing, covering empty, folder, untitled, and named workspace scenarios. (src/vs/workbench/contrib/files/test/browser/explorerView.test.ts)
  • Updated Modern UI contribution tests to account for the new CSS classes and verify that the correct text-transform styles are applied to the Explorer titles and pane headers in various scenarios. (src/vs/workbench/contrib/modernUI/test/browser/modernUI.contribution.test.ts) [1] [2] [3] [4]

These changes ensure that the File Explorer more accurately reflects user intent regarding workspace naming, improving both consistency and user experience.

Copilot AI balanced review requested due to automatic review settings August 19, 2026 14:37
@mrleemurray
Lee Murray (mrleemurray) enabled auto-merge (squash) August 19, 2026 14:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Preserves user-defined workspace casing in File Explorer headers while retaining standard casing for Untitled workspaces.

Changes:

  • Dynamically marks named workspace headers for case preservation.
  • Updates Modern UI CSS selectors.
  • Expands header casing tests.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
explorerView.ts Manages workspace-title casing classes.
fontRamp.css Applies casing rules using those classes.
modernUI.contribution.test.ts Tests Explorer header transforms.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/vs/workbench/contrib/modernUI/test/browser/modernUI.contribution.test.ts Outdated
Extract the untitled-vs-named workspace decision into a testable helper and
assert the resulting header transforms for untitled, named and single folder
workspaces instead of only asserting on hand written CSS classes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@mrleemurray
Lee Murray (mrleemurray) merged commit 5b7b8b5 into main Aug 19, 2026
27 checks passed
@mrleemurray
Lee Murray (mrleemurray) deleted the mrleemurray/structural-lavender-angelfish branch August 19, 2026 16:12
@vs-code-engineering vs-code-engineering Bot added this to the 1.135.0 milestone Aug 19, 2026
Dileep Yavanmandha (dileepyavan) pushed a commit that referenced this pull request Aug 19, 2026
)

* feat: preserve user-defined casing for File Explorer workspace titles

* feat: add support for preserving merged workspace name casing in File Explorer

* test: cover the Explorer workspace name casing decision

Extract the untitled-vs-named workspace decision into a testable helper and
assert the resulting header transforms for untitled, named and single folder
workspaces instead of only asserting on hand written CSS classes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: mrleemurray <mrleemurray@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

3 participants