@gperezmz/bb-plugin-thread-glance 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +20 -0
- package/THIRD_PARTY_NOTICES.md +230 -0
- package/app.tsx +12 -0
- package/components/ui/alert-dialog.tsx +142 -0
- package/components/ui/button.tsx +59 -0
- package/components/ui/card.tsx +83 -0
- package/components/ui/coarse-pointer-sizing.ts +66 -0
- package/components/ui/context-menu.tsx +355 -0
- package/components/ui/dialog.tsx +416 -0
- package/components/ui/dropdown-menu.tsx +640 -0
- package/components/ui/hooks/use-compact-viewport.tsx +37 -0
- package/components/ui/hooks/use-media-query.ts +70 -0
- package/components/ui/hooks/use-pointer-coarse.ts +7 -0
- package/components/ui/hover-card.tsx +36 -0
- package/components/ui/icon-extended.tsx +333 -0
- package/components/ui/icon-registry.ts +189 -0
- package/components/ui/icon.tsx +444 -0
- package/components/ui/input.tsx +30 -0
- package/components/ui/menu-item-hover.tsx +93 -0
- package/components/ui/motion.ts +4 -0
- package/components/ui/overlay-trigger.ts +84 -0
- package/components/ui/popover.tsx +223 -0
- package/components/ui/responsive-overlay.tsx +823 -0
- package/components/ui/tooltip.tsx +63 -0
- package/dist/app.css +2 -0
- package/dist/app.js +66 -0
- package/dist/app.meta.json +11 -0
- package/dist/server.js +71 -0
- package/dist/server.js.map +6 -0
- package/dist/server.meta.json +11 -0
- package/features/thread-list/components/Dialogs.tsx +299 -0
- package/features/thread-list/components/FoldRows.tsx +147 -0
- package/features/thread-list/components/GroupSection.tsx +370 -0
- package/features/thread-list/components/ProviderBadge.tsx +57 -0
- package/features/thread-list/components/PullRequestBadge.tsx +50 -0
- package/features/thread-list/components/Rails.tsx +28 -0
- package/features/thread-list/components/RenameEditor.tsx +118 -0
- package/features/thread-list/components/RowMenu.tsx +168 -0
- package/features/thread-list/components/SplitMiniMap.tsx +55 -0
- package/features/thread-list/components/ThreadDetails.tsx +138 -0
- package/features/thread-list/components/ThreadList.tsx +855 -0
- package/features/thread-list/components/ThreadRowView.tsx +631 -0
- package/features/thread-list/components/Toolbar.tsx +296 -0
- package/features/thread-list/components/controller.ts +64 -0
- package/features/thread-list/components/glyphs.tsx +129 -0
- package/features/thread-list/components/row-card.ts +127 -0
- package/features/thread-list/data/storage.ts +18 -0
- package/features/thread-list/data/useAutoExpand.ts +53 -0
- package/features/thread-list/data/useClientPreferences.ts +20 -0
- package/features/thread-list/data/useNotes.ts +41 -0
- package/features/thread-list/data/useNow.ts +19 -0
- package/features/thread-list/data/usePreferences.ts +126 -0
- package/features/thread-list/data/useScheduled.ts +43 -0
- package/features/thread-list/data/useStamps.ts +68 -0
- package/features/thread-list/icons.ts +44 -0
- package/features/thread-list/index.ts +2 -0
- package/features/thread-list/model/attention.ts +89 -0
- package/features/thread-list/model/counters.ts +67 -0
- package/features/thread-list/model/details.ts +79 -0
- package/features/thread-list/model/drag.ts +104 -0
- package/features/thread-list/model/expansion.ts +71 -0
- package/features/thread-list/model/families.ts +297 -0
- package/features/thread-list/model/groups.ts +263 -0
- package/features/thread-list/model/labels.ts +50 -0
- package/features/thread-list/model/layout.ts +61 -0
- package/features/thread-list/model/menu.ts +78 -0
- package/features/thread-list/model/move.ts +46 -0
- package/features/thread-list/model/notes.ts +52 -0
- package/features/thread-list/model/provider-mark.ts +59 -0
- package/features/thread-list/model/share.ts +101 -0
- package/features/thread-list/model/sort.ts +78 -0
- package/features/thread-list/model/state.ts +330 -0
- package/features/thread-list/model/time.ts +107 -0
- package/features/thread-list/model/toggles.ts +99 -0
- package/features/thread-list/model/view.ts +669 -0
- package/features/thread-list/model/windowing.ts +27 -0
- package/features/thread-list/testing/fixtures.ts +162 -0
- package/hooks/useBrowserDimmingModal.ts +5 -0
- package/lib/portal-scope.ts +15 -0
- package/lib/utils.ts +17 -0
- package/package.json +96 -0
- package/server/cli.ts +107 -0
- package/server/failures.ts +136 -0
- package/server/import.ts +144 -0
- package/server/notes.ts +236 -0
- package/server/preference-store.ts +96 -0
- package/server/scheduled.ts +129 -0
- package/server/serial.ts +12 -0
- package/server/stamps.ts +142 -0
- package/server/startup.ts +121 -0
- package/server.ts +126 -0
- package/shared/contract.ts +73 -0
- package/shared/preferences.ts +241 -0
- package/shared/signals.ts +71 -0
- package/skills/thread-glance/SKILL.md +69 -0
- package/tsconfig.json +36 -0
- package/types/global-jsx.d.ts +10 -0
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
3
|
+
|
|
4
|
+
import { cn } from "../../lib/utils";
|
|
5
|
+
import { usePortalScopeProps } from "../../lib/portal-scope";
|
|
6
|
+
import {
|
|
7
|
+
type ResponsiveOverlayContextValue,
|
|
8
|
+
COMPACT_SHEET_CONTENT_STYLE,
|
|
9
|
+
useResponsiveRoot,
|
|
10
|
+
MobileTrigger,
|
|
11
|
+
ResponsiveDrawerShell,
|
|
12
|
+
stripRadixContentProps,
|
|
13
|
+
} from "./responsive-overlay.js";
|
|
14
|
+
import {
|
|
15
|
+
blurActiveKeyboardInputBeforeOverlayOpen,
|
|
16
|
+
getOverlayTriggerClassName,
|
|
17
|
+
preventOverlayTriggerSelection,
|
|
18
|
+
} from "./overlay-trigger.js";
|
|
19
|
+
import { usePointerCoarse } from "./hooks/use-pointer-coarse.js";
|
|
20
|
+
|
|
21
|
+
const ResponsivePopoverContext =
|
|
22
|
+
React.createContext<ResponsiveOverlayContextValue>({
|
|
23
|
+
isCompactViewport: false,
|
|
24
|
+
open: false,
|
|
25
|
+
onOpenChange: () => {},
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
function useResponsivePopover() {
|
|
29
|
+
return React.useContext(ResponsivePopoverContext);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function Popover({
|
|
33
|
+
children,
|
|
34
|
+
open: controlledOpen,
|
|
35
|
+
onOpenChange: controlledOnChange,
|
|
36
|
+
defaultOpen,
|
|
37
|
+
...props
|
|
38
|
+
}: React.ComponentProps<typeof PopoverPrimitive.Root>) {
|
|
39
|
+
const ctx = useResponsiveRoot(
|
|
40
|
+
controlledOpen,
|
|
41
|
+
controlledOnChange,
|
|
42
|
+
defaultOpen,
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
if (ctx.isCompactViewport) {
|
|
46
|
+
return (
|
|
47
|
+
<ResponsivePopoverContext.Provider value={ctx}>
|
|
48
|
+
{children}
|
|
49
|
+
</ResponsivePopoverContext.Provider>
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return (
|
|
54
|
+
<PopoverPrimitive.Root
|
|
55
|
+
open={ctx.open}
|
|
56
|
+
onOpenChange={ctx.onOpenChange}
|
|
57
|
+
{...props}
|
|
58
|
+
>
|
|
59
|
+
<ResponsivePopoverContext.Provider value={ctx}>
|
|
60
|
+
{children}
|
|
61
|
+
</ResponsivePopoverContext.Provider>
|
|
62
|
+
</PopoverPrimitive.Root>
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const PopoverTrigger = React.forwardRef<
|
|
67
|
+
HTMLButtonElement,
|
|
68
|
+
React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Trigger>
|
|
69
|
+
>(({ asChild, children, className, ...props }, ref) => {
|
|
70
|
+
const { isCompactViewport, open, onOpenChange } = useResponsivePopover();
|
|
71
|
+
|
|
72
|
+
if (isCompactViewport) {
|
|
73
|
+
return (
|
|
74
|
+
<MobileTrigger
|
|
75
|
+
ref={ref}
|
|
76
|
+
asChild={asChild}
|
|
77
|
+
open={open}
|
|
78
|
+
onOpenChange={onOpenChange}
|
|
79
|
+
haspopup="dialog"
|
|
80
|
+
className={className}
|
|
81
|
+
{...props}
|
|
82
|
+
>
|
|
83
|
+
{children}
|
|
84
|
+
</MobileTrigger>
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
return (
|
|
89
|
+
<PopoverPrimitive.Trigger
|
|
90
|
+
ref={ref}
|
|
91
|
+
asChild={asChild}
|
|
92
|
+
className={getOverlayTriggerClassName(className)}
|
|
93
|
+
onMouseDown={(event) => {
|
|
94
|
+
if (!open) {
|
|
95
|
+
blurActiveKeyboardInputBeforeOverlayOpen();
|
|
96
|
+
}
|
|
97
|
+
preventOverlayTriggerSelection(event);
|
|
98
|
+
}}
|
|
99
|
+
{...props}
|
|
100
|
+
>
|
|
101
|
+
{children}
|
|
102
|
+
</PopoverPrimitive.Trigger>
|
|
103
|
+
);
|
|
104
|
+
});
|
|
105
|
+
PopoverTrigger.displayName = "PopoverTrigger";
|
|
106
|
+
|
|
107
|
+
const PopoverContent = React.forwardRef<
|
|
108
|
+
HTMLDivElement,
|
|
109
|
+
React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content> & {
|
|
110
|
+
dismissOnOutsideInteraction?: boolean;
|
|
111
|
+
mobileTitle?: string;
|
|
112
|
+
mobileClassName?: string;
|
|
113
|
+
onMobileContentAnimationEnd?: (open: boolean) => void;
|
|
114
|
+
autoFocusRef?: React.RefObject<HTMLElement | null>;
|
|
115
|
+
}
|
|
116
|
+
>(
|
|
117
|
+
(
|
|
118
|
+
{
|
|
119
|
+
className,
|
|
120
|
+
align = "center",
|
|
121
|
+
sideOffset = 4,
|
|
122
|
+
children,
|
|
123
|
+
dismissOnOutsideInteraction = true,
|
|
124
|
+
onInteractOutside,
|
|
125
|
+
mobileTitle,
|
|
126
|
+
mobileClassName,
|
|
127
|
+
onMobileContentAnimationEnd,
|
|
128
|
+
onOpenAutoFocus,
|
|
129
|
+
autoFocusRef,
|
|
130
|
+
...props
|
|
131
|
+
},
|
|
132
|
+
ref,
|
|
133
|
+
) => {
|
|
134
|
+
const { isCompactViewport, open, onOpenChange } = useResponsivePopover();
|
|
135
|
+
const isPointerCoarse = usePointerCoarse();
|
|
136
|
+
const scopeProps = usePortalScopeProps();
|
|
137
|
+
|
|
138
|
+
React.useEffect(() => {
|
|
139
|
+
if (!open || isCompactViewport || isPointerCoarse || !autoFocusRef)
|
|
140
|
+
return;
|
|
141
|
+
const frame = window.requestAnimationFrame(() => {
|
|
142
|
+
const target = autoFocusRef.current;
|
|
143
|
+
target?.focus();
|
|
144
|
+
if (target instanceof HTMLInputElement) target.select();
|
|
145
|
+
});
|
|
146
|
+
return () => window.cancelAnimationFrame(frame);
|
|
147
|
+
}, [autoFocusRef, isCompactViewport, isPointerCoarse, open]);
|
|
148
|
+
|
|
149
|
+
if (isCompactViewport) {
|
|
150
|
+
const { style, ...domProps } = stripRadixContentProps(props);
|
|
151
|
+
|
|
152
|
+
return (
|
|
153
|
+
<ResponsiveDrawerShell
|
|
154
|
+
open={open}
|
|
155
|
+
onOpenChange={onOpenChange}
|
|
156
|
+
srLabel={mobileTitle ?? "Options"}
|
|
157
|
+
closeOnBackdropClick={dismissOnOutsideInteraction}
|
|
158
|
+
contentClassName={mobileClassName}
|
|
159
|
+
onContentAnimationEnd={onMobileContentAnimationEnd}
|
|
160
|
+
>
|
|
161
|
+
<div
|
|
162
|
+
ref={ref}
|
|
163
|
+
className={cn(
|
|
164
|
+
"overflow-y-auto px-4 pt-2 pb-[max(1rem,env(safe-area-inset-bottom))]",
|
|
165
|
+
className,
|
|
166
|
+
)}
|
|
167
|
+
{...domProps}
|
|
168
|
+
style={{ ...style, ...COMPACT_SHEET_CONTENT_STYLE }}
|
|
169
|
+
>
|
|
170
|
+
{children}
|
|
171
|
+
</div>
|
|
172
|
+
</ResponsiveDrawerShell>
|
|
173
|
+
);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
return (
|
|
177
|
+
<PopoverPrimitive.Portal>
|
|
178
|
+
<PopoverPrimitive.Content
|
|
179
|
+
ref={ref}
|
|
180
|
+
{...scopeProps}
|
|
181
|
+
align={align}
|
|
182
|
+
sideOffset={sideOffset}
|
|
183
|
+
onOpenAutoFocus={(event) => {
|
|
184
|
+
if (isPointerCoarse || autoFocusRef) event.preventDefault();
|
|
185
|
+
if (!isPointerCoarse) onOpenAutoFocus?.(event);
|
|
186
|
+
}}
|
|
187
|
+
className={cn(
|
|
188
|
+
"z-50 w-96 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
|
|
189
|
+
className,
|
|
190
|
+
)}
|
|
191
|
+
{...props}
|
|
192
|
+
onInteractOutside={(event) => {
|
|
193
|
+
if (!dismissOnOutsideInteraction) event.preventDefault();
|
|
194
|
+
onInteractOutside?.(event);
|
|
195
|
+
}}
|
|
196
|
+
>
|
|
197
|
+
{children}
|
|
198
|
+
</PopoverPrimitive.Content>
|
|
199
|
+
</PopoverPrimitive.Portal>
|
|
200
|
+
);
|
|
201
|
+
},
|
|
202
|
+
);
|
|
203
|
+
PopoverContent.displayName = "PopoverContent";
|
|
204
|
+
|
|
205
|
+
const PopoverAnchor = React.forwardRef<
|
|
206
|
+
React.ComponentRef<typeof PopoverPrimitive.Anchor>,
|
|
207
|
+
React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Anchor>
|
|
208
|
+
>(({ children, ...props }, ref) => {
|
|
209
|
+
const { isCompactViewport } = useResponsivePopover();
|
|
210
|
+
|
|
211
|
+
if (isCompactViewport) {
|
|
212
|
+
return <>{children}</>;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
return (
|
|
216
|
+
<PopoverPrimitive.Anchor ref={ref} {...props}>
|
|
217
|
+
{children}
|
|
218
|
+
</PopoverPrimitive.Anchor>
|
|
219
|
+
);
|
|
220
|
+
});
|
|
221
|
+
PopoverAnchor.displayName = "PopoverAnchor";
|
|
222
|
+
|
|
223
|
+
export { Popover, PopoverTrigger, PopoverContent, PopoverAnchor };
|