Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
7280bf4
update rules
sawka Feb 19, 2026
4c6fd13
first cut at new block-tab based badge system
sawka Feb 20, 2026
51489eb
Merge remote-tracking branch 'origin/main' into sawka/block-indicators
sawka Mar 2, 2026
a75253f
run go generate, fix baseds import
sawka Mar 2, 2026
f7fda6a
Merge remote-tracking branch 'origin/main' into sawka/block-indicators
sawka Mar 5, 2026
f3d27e5
move indicators to their own file (badge.ts)
sawka Mar 5, 2026
95ec727
move tabindicatormap too
sawka Mar 5, 2026
ac7f295
move subscription to badge.ts, clean up some warnings
sawka Mar 5, 2026
e3aa0b8
clean up some warnings
sawka Mar 5, 2026
30788d0
setup FE badge store
sawka Mar 5, 2026
a7acdb9
working on badge integration
sawka Mar 5, 2026
f980494
add clearall for badge event
sawka Mar 5, 2026
260c767
add clearbyid
sawka Mar 5, 2026
c448ee7
add badgewatchpid
sawka Mar 5, 2026
f30f394
working on `wsh badge`
sawka Mar 5, 2026
a88c3bf
hook up pid watching to wsh badge command
sawka Mar 5, 2026
8d6f2ad
checkpoint on moving from tabiindicators to badges
sawka Mar 5, 2026
339cd6c
clear transient tab badges with focus as well
sawka Mar 5, 2026
ccf64e6
more badge migration
sawka Mar 5, 2026
498e0d9
remove tabindicators (backend+frontend), more badges
sawka Mar 6, 2026
09fed4e
getting the badges to show... up to 3 on a tab...
sawka Mar 6, 2026
2fb15c4
add flag color
sawka Mar 6, 2026
1806574
add context menu to flag tab...
sawka Mar 6, 2026
144db86
remove badge persistence
sawka Mar 6, 2026
820f535
focus should not clear pidlinked badges
sawka Mar 6, 2026
897f2d4
update tab bar, change flag to be a flag, resort badges
sawka Mar 6, 2026
c737c6e
Merge remote-tracking branch 'origin/main' into sawka/block-indicators
sawka Mar 6, 2026
e50de18
clean up some scss
sawka Mar 6, 2026
ddc9cff
remove ::after psudo element, just render the dividers in react
sawka Mar 6, 2026
9d1007d
dont use ctx in long running poller
sawka Mar 9, 2026
2518d31
fix nits
sawka Mar 9, 2026
dc2315d
fix nit
sawka Mar 9, 2026
64f6d4f
merge main
sawka Mar 9, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update tab bar, change flag to be a flag, resort badges
  • Loading branch information
sawka committed Mar 6, 2026
commit 897f2d4a6193dcdca6cd7468e24b7761ddbbe2a1
4 changes: 2 additions & 2 deletions frontend/app/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ const BadgeAutoClearing = () => {
prevFocusedBlockIdRef.current !== focusedBlockId || prevDocHasFocusRef.current !== documentHasFocus;
prevFocusedBlockIdRef.current = focusedBlockId;
prevDocHasFocusRef.current = documentHasFocus;
const delay = focusSwitched ? 1000 : 3000;
const delay = focusSwitched ? 500 : 3000;
const timeoutId = setTimeout(() => {
if (!document.hasFocus()) {
return;
Expand All @@ -257,7 +257,7 @@ const BadgeAutoClearing = () => {
}
const focusSwitched = prevTabDocHasFocusRef.current !== documentHasFocus;
prevTabDocHasFocusRef.current = documentHasFocus;
const delay = focusSwitched ? 1000 : 3000;
const delay = focusSwitched ? 500 : 3000;
const timeoutId = setTimeout(() => {
if (!document.hasFocus()) {
return;
Expand Down
28 changes: 21 additions & 7 deletions frontend/app/store/badge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,7 @@ function getTabBadgeAtom(tabId: string): Atom<Badge[]> {
if (tabBadge != null) {
badges.push(tabBadge);
}
badges.sort((a, b) => {
if (a.priority !== b.priority) {
return b.priority - a.priority;
}
return b.badgeid < a.badgeid ? -1 : b.badgeid > a.badgeid ? 1 : 0;
});
return badges;
return sortBadgesForTab(badges);
});
TabBadgeAtomCache.set(tabId, rtn);
return rtn;
Expand Down Expand Up @@ -197,6 +191,24 @@ function setupBadgesSubscription() {
});
}

function sortBadges(badges: Badge[]): Badge[] {
return [...badges].sort((a, b) => {
if (a.priority !== b.priority) {
return b.priority - a.priority;
}
return b.badgeid < a.badgeid ? -1 : b.badgeid > a.badgeid ? 1 : 0;
});
}

function sortBadgesForTab(badges: Badge[]): Badge[] {
return [...badges].sort((a, b) => {
if (a.priority !== b.priority) {
return b.priority - a.priority;
}
return a.badgeid < b.badgeid ? -1 : a.badgeid > b.badgeid ? 1 : 0;
});
}

export {
clearAllBadges,
clearBadgeById,
Expand All @@ -209,4 +221,6 @@ export {
loadBadges,
setBadge,
setupBadgesSubscription,
sortBadges,
sortBadgesForTab,
};
5 changes: 3 additions & 2 deletions frontend/app/tab/tab.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
.tab {
position: absolute;
width: 130px;
height: calc(100% - 1px);
height: calc(100% - 3px);
padding: 0 0 0 0;
box-sizing: border-box;
font-weight: bold;
Expand Down Expand Up @@ -45,7 +45,8 @@
}

.name {
color: var(--main-text-color);
color: rgba(255, 255, 255, 1);
font-weight: 600;
}

& + .tab::after,
Expand Down
37 changes: 20 additions & 17 deletions frontend/app/tab/tab.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright 2026, Command Line Inc.
// SPDX-License-Identifier: Apache-2.0

import { getTabBadgeAtom } from "@/app/store/badge";
import { getTabBadgeAtom, sortBadgesForTab } from "@/app/store/badge";
import { atoms, getOrefMetaKeyAtom, globalStore, recordTEvent, refocusNode } from "@/app/store/global";
import { RpcApi } from "@/app/store/wshclientapi";
import { TabRpcClient } from "@/app/store/wshrpcutil";
Expand All @@ -11,7 +11,8 @@ import { validateCssColor } from "@/util/color-validator";
import { fireAndForget, makeIconClass } from "@/util/util";
import clsx from "clsx";
import { useAtomValue } from "jotai";
import { forwardRef, memo, useCallback, useEffect, useImperativeHandle, useRef, useState } from "react";
import { forwardRef, memo, useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState } from "react";
import { v7 as uuidv7 } from "uuid";
import { ObjectService } from "../store/services";
import { makeORef, useWaveObjectValue } from "../store/wos";
import "./tab.scss";
Expand All @@ -37,14 +38,24 @@ interface TabVProps {

interface TabBadgesProps {
badges?: Badge[] | null;
flagColor?: string | null;
}

function TabBadges({ badges }: TabBadgesProps) {
if (!badges?.[0]) {
function TabBadges({ badges, flagColor }: TabBadgesProps) {
const flagBadgeId = useMemo(() => uuidv7(), []);
const allBadges = useMemo(() => {
const base = badges ?? [];
if (!flagColor) {
return base;
}
const flagBadge: Badge = { icon: "flag", color: flagColor, priority: 0, badgeid: flagBadgeId };
return sortBadgesForTab([...base, flagBadge]);
}, [badges, flagColor, flagBadgeId]);
if (!allBadges[0]) {
return null;
}
const firstBadge = badges[0];
const extraBadges = badges.slice(1, 3);
const firstBadge = allBadges[0];
const extraBadges = allBadges.slice(1, 3);
return (
<div className="tab-indicator pointer-events-none flex items-center">
<i
Expand Down Expand Up @@ -202,12 +213,6 @@ const TabV = forwardRef<HTMLDivElement, TabVProps>((props, ref) => {
data-tab-id={tabId}
>
<div className="tab-inner">
{flagColor && (
<div
className="pointer-events-none absolute bottom-0 left-0 right-0 rounded-b-[6px]"
style={{ height: "3px", backgroundColor: flagColor, opacity: active ? 1 : 0.6 }}
/>
)}
<div
ref={editableRef}
className={clsx("name", { focused: isEditable })}
Expand All @@ -219,7 +224,7 @@ const TabV = forwardRef<HTMLDivElement, TabVProps>((props, ref) => {
>
{tabName}
</div>
<TabBadges badges={badges} />
<TabBadges badges={badges} flagColor={flagColor} />
<Button
className="ghost grey close"
onClick={onClose}
Expand Down Expand Up @@ -266,15 +271,13 @@ function buildTabContextMenu(
label: "None",
type: "checkbox",
checked: currentFlagColor == null,
click: () =>
fireAndForget(() => ObjectService.UpdateObjectMeta(tabORef, { "tab:flagcolor": null })),
click: () => fireAndForget(() => ObjectService.UpdateObjectMeta(tabORef, { "tab:flagcolor": null })),
},
...FlagColors.map((fc) => ({
label: fc.label,
type: "checkbox" as const,
checked: currentFlagColor === fc.value,
click: () =>
fireAndForget(() => ObjectService.UpdateObjectMeta(tabORef, { "tab:flagcolor": fc.value })),
click: () => fireAndForget(() => ObjectService.UpdateObjectMeta(tabORef, { "tab:flagcolor": fc.value })),
})),
];
menu.push({ label: "Flag Tab", type: "submenu", submenu: flagSubmenu }, { type: "separator" });
Expand Down
7 changes: 6 additions & 1 deletion frontend/app/tab/tabbar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0

.tab-bar-wrapper {
padding-top: 6px;
padding-top: 3px;
position: relative;
user-select: none;
display: flex;
Expand All @@ -11,6 +11,9 @@
width: 100vw;
-webkit-app-region: drag;
height: max(33px, calc(33px * var(--zoomfactor-inv)));
backdrop-filter: blur(20px);
background: rgba(0, 0, 0, 0.35);
flex-shrink: 0;

button {
-webkit-app-region: no-drag;
Expand All @@ -27,6 +30,7 @@
flex-direction: row;
height: 27px;
-webkit-app-region: no-drag;
margin-bottom: 1px;
}

.pinned-tab-spacer {
Expand All @@ -48,6 +52,7 @@
.add-tab {
padding: 0 10px;
height: 27px;
margin-bottom: 2px;
}

// Customize scrollbar styles
Expand Down
7 changes: 3 additions & 4 deletions frontend/app/tab/tabbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,12 @@ const WaveAIButton = memo(({ divRef }: { divRef?: React.RefObject<HTMLDivElement
content="Toggle Wave AI Panel"
placement="bottom"
hideOnClick
divClassName={`flex h-[26px] px-1.5 justify-end items-center rounded-md mr-1 box-border cursor-pointer bg-hover hover:bg-hoverbg transition-colors text-[12px] ${aiPanelOpen ? "text-accent" : "text-secondary"}`}
divClassName={`flex h-[22px] px-3.5 justify-end mb-1 items-center rounded-md mr-1 box-border cursor-pointer bg-hover hover:bg-hoverbg transition-colors text-[12px] ${aiPanelOpen ? "text-accent" : "text-secondary"}`}
divStyle={{ WebkitAppRegion: "no-drag" } as React.CSSProperties}
divOnClick={onClick}
divRef={divRef}
>
<i className="fa fa-sparkles" />
<span className="font-bold ml-1 -top-px font-mono">AI</span>
</Tooltip>
);
});
Expand Down Expand Up @@ -645,7 +644,7 @@ const TabBar = memo(({ workspace }: TabBarProps) => {
}

// Calculate window drag right width
let windowDragRightWidth = 6;
let windowDragRightWidth = 12;
if (isWindows()) {
if (zoomFactor > 0) {
windowDragRightWidth = 139 / zoomFactor;
Expand Down Expand Up @@ -683,7 +682,7 @@ const TabBar = memo(({ workspace }: TabBarProps) => {
placement="bottom"
hideOnClick
divRef={workspaceSwitcherRef}
divClassName="flex items-center h-full"
divClassName="flex items-center"
>
<WorkspaceSwitcher />
</Tooltip>
Expand Down
3 changes: 2 additions & 1 deletion frontend/app/tab/workspaceswitcher.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@

.workspace-switcher-button {
display: flex;
height: 26px;
height: 22px;
padding: 0px 12px;
justify-content: flex-end;
align-items: center;
gap: 12px;
border-radius: 6px;
margin-right: 6px;
margin-bottom: 4px;
box-sizing: border-box;
background-color: rgb(from var(--main-text-color) r g b / 0.1) !important;

Expand Down