Skip to content

Commit

Permalink
Add emphasis to entrypoint TreeItem in Files
Browse files Browse the repository at this point in the history
  • Loading branch information
dotNomad committed Nov 14, 2024
1 parent 1efe811 commit 6fe68b9
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
:class="{
'align-icon-with-twisty': alignIconWithTwisty,
collapsible: $slots.default,
'text-list-emphasized': listStyle === 'emphasized',
'text-foreground': listStyle === 'default',
'text-list-deemphasized': listStyle === 'deemphasized',
}"
Expand Down Expand Up @@ -60,7 +61,7 @@
<script setup lang="ts">
import ActionToolbar, { ActionButton } from "src/components/ActionToolbar.vue";
export type TreeItemStyle = "default" | "deemphasized";
export type TreeItemStyle = "emphasized" | "default" | "deemphasized";
const expanded = defineModel("expanded", { required: false, default: false });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
:class="{
'align-icon-with-twisty': alignIconWithTwisty,
collapsible: $slots.default,
'text-list-emphasized': listStyle === 'emphasized',
'text-foreground': listStyle === 'default',
'text-list-deemphasized': listStyle === 'deemphasized',
}"
Expand Down Expand Up @@ -54,7 +55,7 @@
<script setup lang="ts">
import ActionToolbar, { ActionButton } from "src/components/ActionToolbar.vue";
export type TreeItemStyle = "default" | "deemphasized";
export type TreeItemStyle = "emphasized" | "default" | "deemphasized";
const expanded = defineModel("expanded", { required: false, default: false });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@
file.reason?.source === 'built-in' ||
file.reason?.source === 'permissions'
"
:list-style="isFileIncluded(file) ? 'default' : 'deemphasized'"
:list-style="
isEntrypoint(file)
? 'emphasized'
: isFileIncluded(file)
? 'default'
: 'deemphasized'
"
:tooltip="
isFileIncluded(file)
? includedFileTooltip(file)
Expand Down Expand Up @@ -61,7 +67,10 @@ import { useHostConduitService } from "src/HostConduitService";
import PostDecor from "src/components/tree/PostDecor.vue";
import { ActionButton } from "src/components/ActionToolbar.vue";
import { ContentRecordFile, FileMatchSource } from "../../../../../../src/api";
import {
ContentRecordFile,
isConfigurationError,
} from "../../../../../../src/api";
import { WebviewToHostMessageType } from "../../../../../../src/types/messages/webviewToHostMessages";
interface Props {
Expand All @@ -76,6 +85,14 @@ const props = withDefaults(defineProps<Props>(), {
const home = useHomeStore();
const { sendMsg } = useHostConduitService();
const isEntrypoint = (file: ContentRecordFile): boolean => {
const config = home.selectedConfiguration;
if (config != undefined && !isConfigurationError(config)) {
return file.id === config.configuration.entrypoint;
}
return false;
};
const isFileIncluded = (file: ContentRecordFile) => {
return Boolean(file.reason?.exclude === false);
};
Expand Down
4 changes: 4 additions & 0 deletions extensions/vscode/webviews/homeView/src/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ body {
color: var(--vscode-icon-foreground);
}

.text-list-emphasized {
color: var(--vscode-list-activeSelectionForeground);
}

.text-list-deemphasized {
color: var(--vscode-list-deemphasizedForeground);
}
Expand Down

0 comments on commit 6fe68b9

Please sign in to comment.