Skip to content
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

Add emphasis to entrypoint TreeItem in Files #2435

Merged
merged 1 commit into from
Nov 18, 2024

Conversation

dotNomad
Copy link
Collaborator

Adds the ability to emphasize our Tree Item components with a new listStyle prop option, then uses that to emphasize the entrypoint.

Intent

Resolves #2239

Type of Change

    • Bug Fix
    • New Feature
    • Breaking Change
    • Documentation
    • Refactor
    • Tooling

Approach

The approach was to use a CSS variable provided by VS Code, in this case --vscode-list-activeSelectionForeground. This is the same color as the active file when looking at the Explorer.

User Impact

This provides the user a bit of glanceability to the understand what the "main"/entrypoint file is when looking at the Project Files view. It reinforces the most important file being deployed.

This is particularly helpful if the folder has multiple deployments with multiple entrypoints.

This option of using the same color as the active file in the Explorer view may be a bit confusing since our Project Files looks a bit like the Explorer pane, and has the "open file" icon button. This is opened as a draft to discuss this.

@dotNomad dotNomad marked this pull request as ready for review November 14, 2024 01:36
Comment on lines +88 to +94
const isEntrypoint = (file: ContentRecordFile): boolean => {
const config = home.selectedConfiguration;
if (config != undefined && !isConfigurationError(config)) {
return file.id === config.configuration.entrypoint;
}
return false;
};
Copy link
Collaborator

Choose a reason for hiding this comment

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

Oh, nice. It's nice that this code is closer to the actual display as well — keeps the logic closer to the thing that uses it.

I wonder why we thought we required this to come from the backend in the first place?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I wonder why we thought we required this to come from the backend in the first place?

I don't quite recall, but I think we have a tendency to move logic to the backend if we do (or would) repeat it a lot on the display side. This may have been one of those we made the judgement too early calls and we didn't actually need isEntrypoint all that much.

@dotNomad dotNomad merged commit f1cb8ec into main Nov 18, 2024
14 checks passed
@dotNomad dotNomad deleted the dotnomad/emphasize-tree-item branch November 18, 2024 17:29
@marcosnav
Copy link
Collaborator

Validation screenshot (entrypoint highlighted)

Screen Shot 2024-11-21 at 6 18 48

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.

Emphasize the entrypoint in the Project Files tree
3 participants