New colors for workspace switcher (#1443)

Also updates workspace switcher button and tab bg colors
This commit is contained in:
Evan Simkowitz 2024-12-09 16:24:32 -08:00 committed by GitHub
parent c071cc04c3
commit edab90aa55
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 42 additions and 31 deletions

View File

@ -41,7 +41,7 @@
.tab-inner {
border-color: transparent;
border-radius: 6px;
background: rgb(from var(--main-text-color) r g b / 0.14);
background: rgb(from var(--main-text-color) r g b / 0.1);
}
.name {
@ -111,7 +111,7 @@ body:not(.nohover) .tab:hover {
.tab-inner {
border-color: transparent;
background: rgb(from var(--main-text-color) r g b / 0.14);
background: rgb(from var(--main-text-color) r g b / 0.1);
}
.close {
visibility: visible;

View File

@ -9,10 +9,14 @@
align-items: center;
gap: 12px;
border-radius: 6px;
background: var(--modal-bg-color);
margin-top: 6px;
margin-right: 13px;
box-sizing: border-box;
background-color: rgb(from var(--main-text-color) r g b / 0.1) !important;
&:hover {
background-color: rgb(from var(--main-text-color) r g b / 0.14) !important;
}
.workspace-icon {
width: 15px;

View File

@ -32,6 +32,33 @@ interface ColorSelectorProps {
className?: string;
}
const colors = [
"#58C142", // Green (accent)
"#00FFDB", // Teal
"#429DFF", // Blue
"#BF55EC", // Purple
"#FF453A", // Red
"#FF9500", // Orange
"#FFE900", // Yellow
];
const icons = [
"triangle",
"star",
"cube",
"gem",
"chess-knight",
"heart",
"plane",
"rocket",
"shield-cat",
"paw-simple",
"umbrella",
"graduation-cap",
"mug-hot",
"circle",
];
const ColorSelector = memo(({ colors, selectedColor, onSelect, className }: ColorSelectorProps) => {
const handleColorClick = (color: string) => {
onSelect(color);
@ -117,31 +144,8 @@ const ColorAndIconSelector = memo(
value={title}
autoFocus
/>
<ColorSelector
selectedColor={color}
colors={["#e91e63", "#8bc34a", "#ff9800", "#ffc107", "#03a9f4", "#3f51b5", "#f44336"]}
onSelect={onColorChange}
/>
<IconSelector
selectedIcon={icon}
icons={[
"triangle",
"star",
"cube",
"gem",
"chess-knight",
"heart",
"plane",
"rocket",
"shield-cat",
"paw-simple",
"umbrella",
"graduation-cap",
"mug-hot",
"circle",
]}
onSelect={onIconChange}
/>
<ColorSelector selectedColor={color} colors={colors} onSelect={onColorChange} />
<IconSelector selectedIcon={icon} icons={icons} onSelect={onIconChange} />
<div className="delete-ws-btn-wrapper">
<Button className="ghost red font-size-12" onClick={onDeleteWorkspace}>
Delete workspace
@ -204,7 +208,11 @@ const WorkspaceSwitcher = () => {
);
const saveWorkspace = () => {
setObjectValue({ ...activeWorkspace, name: "New Workspace", icon: "circle", color: "green" }, undefined, true);
setObjectValue(
{ ...activeWorkspace, name: "New Workspace", icon: "circle", color: colors[0] },
undefined,
true
);
setTimeout(() => {
fireAndForget(updateWorkspaceList);
}, 10);

View File

@ -54,7 +54,7 @@ func EnsureInitialData() error {
return nil
}
log.Println("client has no windows, creating starter workspace")
starterWs, err := CreateWorkspace(ctx, "Starter workspace", "circle", "green", true)
starterWs, err := CreateWorkspace(ctx, "Starter workspace", "circle", "#58C142", true)
if err != nil {
return fmt.Errorf("error creating starter workspace: %w", err)
}

View File

@ -18,7 +18,6 @@ import (
)
func CreateWorkspace(ctx context.Context, name string, icon string, color string, isInitialLaunch bool) (*waveobj.Workspace, error) {
log.Println("CreateWorkspace")
ws := &waveobj.Workspace{
OID: uuid.NewString(),
TabIds: []string{},