Skip to content

Add folder workspace icon #19366

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

Merged
merged 33 commits into from
Jun 27, 2025
Merged

Add folder workspace icon #19366

merged 33 commits into from
Jun 27, 2025

Conversation

madsrasmussen
Copy link
Contributor

@madsrasmussen madsrasmussen commented May 20, 2025

This PR adds a workspace icon for all folders.

It also aligns how we render a folder by introducing an element we can use across all workspaces. We should add a 'kind' for this element at some point.

Currently, it is not possible to change the name of a file system folder, which means that the name field should be read-only in this case. The PR also introduces a UmbNameWriteGuardManager that can be used within all namable workspaces. The Partial View, Stylesheet, and Script workspaces add a rule to this manager to prevent the name from being edited.

@nielslyngsoe
Copy link
Member

@madsrasmussen I love it, it seems done? so should we get it in?

@madsrasmussen
Copy link
Contributor Author

madsrasmussen commented May 21, 2025

@nielslyngsoe I found a small hiccup yesterday. The file system folders should have a readonly name field, but after I have changed it to use the umb-folder-workspace-element then the name is editable.

I am trying to think of a good generic way to make the name readonly. Maybe something with guards. 🤔

@madsrasmussen madsrasmussen marked this pull request as ready for review May 23, 2025 13:45
@Copilot Copilot AI review requested due to automatic review settings May 23, 2025 13:45
@madsrasmussen
Copy link
Contributor Author

@nielslyngsoe This PR has been updated to also work correctly for file system workspaces. Please see description for more details.

Copy link
Contributor

@Copilot 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 standardizes folder workspaces by introducing a shared editor element with an icon, adds a name write guard to prevent renames on file system folders, and updates all folder workspace editors to use the new shared component.

  • Introduced UmbFolderWorkspaceEditorElement to render folder workspaces with a consistent icon and name field.
  • Replaced custom rendering in various folder workspace editor elements to use the shared folder workspace editor.
  • Added UmbNameWriteGuardManager and applied rename-prevention rules for file system folders in relevant contexts.

Reviewed Changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
templating/stylesheets/tree/folder/workspace/stylesheet-folder-workspace-editor.element.ts Added name write guard rule and switched to shared folder workspace editor.
templating/scripts/tree/folder/workspace/script-folder-workspace-editor.element.ts Added name write guard rule, switched to shared editor, and updated import path.
templating/partial-views/tree/folder/workspace/partial-view-folder-workspace-editor.element.ts Added name write guard rule and switched to shared folder workspace editor.
media/media-types/tree/folder/workspace/media-type-folder-editor.element.ts Switched to shared folder workspace editor component.
documents/document-types/tree/folder/workspace/document-type-folder-editor.element.ts Switched to shared folder workspace editor component.
documents/document-blueprints/tree/folder/workspace/document-blueprint-folder-editor.element.ts Switched to shared folder workspace editor component.
data-type/tree/folder/workspace/data-type-folder-editor.element.ts Switched to shared folder workspace editor component.
core/workspace/namable/name-write-guard.manager.ts Introduced UmbNameWriteGuardManager to manage rename-permission rules.
core/workspace/namable/namable-workspace-context.interface.ts Added nameWriteGuard to the namable workspace context interface.
core/workspace/namable/index.ts Exported the new name write guard manager.
core/workspace/entity-detail/entity-named-detail-workspace-base.ts Integrated UmbNameWriteGuardManager into entity-named-detail workspaces with default fallback.
core/workspace/components/workspace-header-name-editable/workspace-header-name-editable.element.ts Observes write guard rules to disable the name input when renaming is prevented.
core/tree/folder/workspace/index.ts Registered the new shared folder workspace editor element.
core/tree/folder/workspace/folder-workspace-editor.element.ts Created the shared folder workspace editor with icon styling.
core/tree/folder/index.ts Exported the workspace folder module.
Comments suppressed due to low confidence (1)

src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/tree/folder/workspace/partial-view-folder-workspace-editor.element.ts:14

  • [nitpick] The message text casing for 'Partial View folder' should be consistent with other folder types (e.g., capitalize or lowercase 'script folder', 'stylesheet folder') to maintain a uniform user experience.
message: 'It is not possible to change the name of a Partial View folder.',

Copy link
Member

@nielslyngsoe nielslyngsoe left a comment

Choose a reason for hiding this comment

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

Changes looks good, have though not tested this yet.

@iOvergaard iOvergaard merged commit b7be95b into main Jun 27, 2025
27 checks passed
@iOvergaard iOvergaard deleted the v16/feature/folder-workspace-icon branch June 27, 2025 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants