Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

chore(today): remove space previews and file to for chats (#112562)

Shy Alter026f1d4ae966
diff --git a/frontend/src/layout/today/TodayChatHoverCard.tsx b/frontend/src/layout/today/TodayChatHoverCard.tsx
index df625821d2f3..5847ed332cc2 100644
--- a/frontend/src/layout/today/TodayChatHoverCard.tsx
+++ b/frontend/src/layout/today/TodayChatHoverCard.tsx
@@ -9,8 +9,6 @@ import { cardMenuParts } from './todayMenuParts'
import { TodayChatPreview } from './todayPreviewCards'
import { activityDetail } from './todayWorkItems'
-const NO_SUBMENU = (): void => {}
-
export function TodayChatHoverCard({
preview,
onAction,
@@ -19,7 +17,7 @@ export function TodayChatHoverCard({
onAction: () => void
}): JSX.Element {
const updated = activityDetail(preview.timestamp)
- const parts = useMemo(() => cardMenuParts(onAction, NO_SUBMENU), [onAction])
+ const parts = useMemo(() => cardMenuParts(onAction), [onAction])
return (
<div className="flex flex-col" data-attr="today-chat-hover-card">
<Item size="xs" className="items-start">
diff --git a/frontend/src/layout/today/TodayPreviewCardProvider.tsx b/frontend/src/layout/today/TodayPreviewCardProvider.tsx
index a67cf288f386..ad99c8d2db38 100644
--- a/frontend/src/layout/today/TodayPreviewCardProvider.tsx
+++ b/frontend/src/layout/today/TodayPreviewCardProvider.tsx
@@ -18,9 +18,6 @@ const TodayChatHoverCard = lazyWithRetry(() =>
const TodaySessionHoverCard = lazyWithRetry(() =>
import('./TodaySessionHoverCard').then((m) => ({ default: m.TodaySessionHoverCard }))
)
-const TodaySpaceHoverCard = lazyWithRetry(() =>
- import('./TodaySpaceHoverCard').then((m) => ({ default: m.TodaySpaceHoverCard }))
-)
function isInTextLink(payload: TodayPreviewPayload): boolean {
return payload.kind === 'report' && payload.surface === 'briefing'
@@ -68,8 +65,6 @@ export function TodayPreviewCardProvider({
}): JSX.Element {
const [handle] = useState(() => PreviewCard.createHandle<TodayPreviewPayload>())
const [open, setOpen] = useState(false)
- // "File to…" opens outside the card, so the pointer moving there reads as leaving it.
- const [submenuOpen, setSubmenuOpen] = useState(false)
// A ref, so a hover that lands while a menu is open is refused on the same event.
const menuOpen = useRef(false)
const card = useMemo<TodayPreviewCard>(
@@ -86,7 +81,6 @@ export function TodayPreviewCardProvider({
)
useEffect(trackPointer, [])
const close = useCallback(() => {
- setSubmenuOpen(false)
setOpen(false)
}, [])
@@ -96,7 +90,7 @@ export function TodayPreviewCardProvider({
<PreviewCard.Root
handle={handle}
// A session dialog or the bulk archive confirm keeps the card shut, so the card cannot open over it.
- open={(open || submenuOpen) && !disabled}
+ open={open && !disabled}
onOpenChange={(next) => setOpen(next && !menuOpen.current && !disabled)}
>
{({ payload }) =>
@@ -110,20 +104,12 @@ export function TodayPreviewCardProvider({
className="w-72 gap-0 border border-border py-0 shadow-[var(--shadow-md)]"
>
<Suspense fallback={<Skeleton className="h-24 w-full" />}>
- {payload.kind === 'space' ? (
- <TodaySpaceHoverCard preview={payload} onAction={close} />
- ) : payload.kind === 'chat' ? (
+ {payload.kind === 'chat' ? (
<TodayChatHoverCard preview={payload} onAction={close} />
) : payload.kind === 'report' ? (
<TodayReportHoverCard preview={payload} />
) : (
- <TodaySessionHoverCard
- // Keyed on the row, so moving to another row unmounts the card and lowers the submenu flag.
- key={payload.menu.menuId}
- preview={payload}
- onAction={close}
- onSubmenuOpenChange={setSubmenuOpen}
- />
+ <TodaySessionHoverCard preview={payload} onAction={close} />
)}
</Suspense>
</Card>
diff --git a/frontend/src/layout/today/TodaySessionActionItems.tsx b/frontend/src/layout/today/TodaySessionActionItems.tsx
index 568af3a1a401..46485f0f714b 100644
--- a/frontend/src/layout/today/TodaySessionActionItems.tsx
+++ b/frontend/src/layout/today/TodaySessionActionItems.tsx
@@ -5,7 +5,6 @@ import {
IconCheckbox,
IconCopy,
IconExternal,
- IconFolder,
IconPencil,
IconPin,
IconPinFilled,
@@ -23,8 +22,6 @@ import { todayArchiveShortcutLabel } from './todaySessionArchiveShortcut'
import { TodaySessionSurface, todaySessionMenuLogic } from './todaySessionMenuLogic'
import { todaySessionSelectionLogic } from './todaySessionSelectionLogic'
import { todayShellLogic } from './todayShellLogic'
-import { TodaySpaceFileList } from './TodaySpaceFileList'
-import { todaySpacesLogic } from './todaySpacesLogic'
import { TodaySessionMenuTarget } from './todayWorkItems'
interface TodaySessionActionItemsProps {
@@ -37,20 +34,18 @@ interface TodaySessionActionItemsProps {
/** A session's actions, in Desktop's order: the edits, the places it can go, then archive last. */
export function TodaySessionActionItems({
- parts: { Item, Separator, Shortcut, Sub },
+ parts: { Item, Separator, Shortcut },
target,
surface,
dataAttrPrefix,
}: TodaySessionActionItemsProps): JSX.Element {
const { featureFlags } = useValues(featureFlagLogic)
- const { spaces } = useValues(todaySpacesLogic)
const { phoneLayout } = useValues(todayShellLogic)
const { toggleSessionSelection } = useActions(todaySessionSelectionLogic)
const {
setSessionPinned,
startRenaming,
requestArchive,
- moveSession,
openHandoff,
analyzeSession,
openSessionInNewTab,
@@ -93,25 +88,6 @@ export function TodaySessionActionItems({
Stop session
</Item>
)}
- {spaces.length > 0 && (
- <Sub
- label={
- <>
- <IconFolder />
- File to…
- </>
- }
- title="File to…"
- dataAttr={attr('file')}
- >
- <TodaySpaceFileList
- currentSpaceId={target.spaceId}
- onSelect={(spaceId) => moveSession(sessionId, spaceId)}
- itemDataAttr={attr('move')}
- searchDataAttr={attr('move-search')}
- />
- </Sub>
- )}
{target.canHandOff && (
<Item onClick={() => openHandoff(menuId)} dataAttr={attr('handoff')}>
<IconSend />
diff --git a/frontend/src/layout/today/TodaySessionBulkActionItems.tsx b/frontend/src/layout/today/TodaySessionBulkActionItems.tsx
index fbb58fd39514..a834bda864d1 100644
--- a/frontend/src/layout/today/TodaySessionBulkActionItems.tsx
+++ b/frontend/src/layout/today/TodaySessionBulkActionItems.tsx
@@ -1,37 +1,28 @@
-import { useValues } from 'kea'
-
-import { IconArchive, IconFolder, IconPin, IconPinFilled } from '@posthog/icons'
+import { IconArchive, IconPin, IconPinFilled } from '@posthog/icons'
import { TodayMenuParts } from './todayMenuParts'
import { sessionsLabel } from './todaySessionSelection'
import type { TodayBulkAction } from './todaySessionSelectionLogic'
-import { TodaySpaceFileList } from './TodaySpaceFileList'
-import { todaySpacesLogic } from './todaySpacesLogic'
/** The sidebar's selection, or one space feed's. Both offer the same bulk changes. */
export interface TodayBulkSelection {
- /** The space every selected session sits in, or `null` when the selection spans spaces. */
- spaceId: string | null
selectedSessionIds: string[]
bulkPinDirection: 'pin' | 'unpin'
bulkAction: TodayBulkAction | null
runningSelectedCount: number
pinSelected: () => void
- fileSelectedTo: (spaceId: string) => void
requestBulkArchive: () => void
}
/** What the selection bar offers, as menu items, so a right-click on a selected row acts on the whole selection. */
export function TodaySessionBulkActionItems({
- parts: { Item, Separator, Sub },
+ parts: { Item, Separator },
selection: {
- spaceId,
selectedSessionIds,
bulkPinDirection,
bulkAction,
runningSelectedCount,
pinSelected,
- fileSelectedTo,
requestBulkArchive,
},
dataAttrPrefix,
@@ -41,13 +32,10 @@ export function TodaySessionBulkActionItems({
/** Starts each item's `data-attr`, so every surface counts on its own. */
dataAttrPrefix: string
}): JSX.Element {
- const { spaces } = useValues(todaySpacesLogic)
const sessions = sessionsLabel(selectedSessionIds.length)
const pin = bulkPinDirection === 'pin'
- // One bulk change at a time, like the selection bar. "File to…" hides, because a submenu can't be disabled here.
+ // One bulk change at a time, like the selection bar.
const busy = bulkAction !== null
- // Filing needs a space other than the one the sessions already sit in.
- const canFile = spaces.length > (spaceId ? 1 : 0)
const attr = (name: string): string => `${dataAttrPrefix}-${name}`
return (
@@ -56,25 +44,6 @@ export function TodaySessionBulkActionItems({
{pin ? <IconPin /> : <IconPinFilled />}
{`${pin ? 'Pin' : 'Unpin'} ${sessions}`}
</Item>
- {canFile && !busy && (
- <Sub
- label={
- <>
- <IconFolder />
- {`File ${sessions} to…`}
- </>
- }
- title={`File ${sessions} to…`}
- dataAttr={attr('file')}
- >
- <TodaySpaceFileList
- currentSpaceId={spaceId}
- onSelect={fileSelectedTo}
- itemDataAttr={attr('file-space')}
- searchDataAttr={attr('file-search')}
- />
- </Sub>
- )}
<Separator />
<Item onClick={requestBulkArchive} disabled={busy} dataAttr={attr('archive')}>
<IconArchive />
diff --git a/frontend/src/layout/today/TodaySessionBulkBar.tsx b/frontend/src/layout/today/TodaySessionBulkBar.tsx
index d935ecb21fba..55f96fe0aa5e 100644
--- a/frontend/src/layout/today/TodaySessionBulkBar.tsx
+++ b/frontend/src/layout/today/TodaySessionBulkBar.tsx
@@ -1,23 +1,12 @@
import { useActions, useValues } from 'kea'
-import { IconArchive, IconFolder, IconPin, IconPinFilled, IconX } from '@posthog/icons'
-import {
- Button,
- DropdownMenu,
- DropdownMenuContent,
- DropdownMenuTrigger,
- Text,
- Tooltip,
- TooltipContent,
- TooltipTrigger,
-} from '@posthog/quill'
+import { IconArchive, IconPin, IconPinFilled, IconX } from '@posthog/icons'
+import { Button, Text, Tooltip, TooltipContent, TooltipTrigger } from '@posthog/quill'
import { TodaySessionBulkArchiveDialog } from './TodaySessionBulkArchiveDialog'
import { sessionsLabel } from './todaySessionSelection'
import { TodayBulkAction, todaySessionSelectionLogic } from './todaySessionSelectionLogic'
import { todayShellLogic } from './todayShellLogic'
-import { TodaySpaceFileList } from './TodaySpaceFileList'
-import { todaySpacesLogic } from './todaySpacesLogic'
const BUSY_REASON = 'Wait for the current change to finish'
@@ -26,13 +15,11 @@ interface BulkButtonProps {
action: TodayBulkAction | null
icon: JSX.Element
dataAttr: string
- onClick?: () => void
- /** Wraps the button before the tooltip does, so it can open a menu. */
- wrap?: (button: JSX.Element) => JSX.Element
+ onClick: () => void
}
/** The sidebar is narrow, so each action is an icon button that names itself in its tooltip, like Desktop's bar. */
-function BulkButton({ label, action, icon, dataAttr, onClick, wrap }: BulkButtonProps): JSX.Element {
+function BulkButton({ label, action, icon, dataAttr, onClick }: BulkButtonProps): JSX.Element {
const { bulkAction } = useValues(todaySessionSelectionLogic)
const loading = action !== null && bulkAction === action
const busy = bulkAction !== null && !loading
@@ -48,7 +35,7 @@ function BulkButton({ label, action, icon, dataAttr, onClick, wrap }: BulkButton
)
return (
<Tooltip>
- <TooltipTrigger delay={0} render={wrap ? wrap(button) : button}>
+ <TooltipTrigger delay={0} render={button}>
{icon}
</TooltipTrigger>
<TooltipContent side="top">{busy ? BUSY_REASON : label}</TooltipContent>
@@ -59,15 +46,8 @@ function BulkButton({ label, action, icon, dataAttr, onClick, wrap }: BulkButton
export function TodaySessionBulkBar(): JSX.Element {
const { selectedSessionIds, bulkPinDirection, bulkArchiveConfirm, bulkAction } =
useValues(todaySessionSelectionLogic)
- const {
- pinSelected,
- fileSelectedTo,
- requestBulkArchive,
- clearSelection,
- closeBulkArchiveConfirm,
- archiveSelected,
- } = useActions(todaySessionSelectionLogic)
- const { spaces } = useValues(todaySpacesLogic)
+ const { pinSelected, requestBulkArchive, clearSelection, closeBulkArchiveConfirm, archiveSelected } =
+ useActions(todaySessionSelectionLogic)
const { phoneLayout } = useValues(todayShellLogic)
const count = selectedSessionIds.length
const minimum = phoneLayout ? 1 : 2
@@ -103,25 +83,6 @@ export function TodaySessionBulkBar(): JSX.Element {
onClick={pinSelected}
dataAttr="today-session-bulk-pin"
/>
- {spaces.length > 0 && (
- <DropdownMenu>
- <BulkButton
- label={`File ${sessions} to a space`}
- action="file"
- icon={<IconFolder />}
- wrap={(button) => <DropdownMenuTrigger render={button} />}
- dataAttr="today-session-bulk-file"
- />
- <DropdownMenuContent align="end" side="top" className="max-h-80 w-64">
- <TodaySpaceFileList
- currentSpaceId={null}
- onSelect={fileSelectedTo}
- itemDataAttr="today-session-bulk-file-space"
- searchDataAttr="today-session-bulk-file-search"
- />
- </DropdownMenuContent>
- </DropdownMenu>
- )}
<BulkButton
label={`Archive ${sessions}`}
action="archive"
diff --git a/frontend/src/layout/today/TodaySessionHoverCard.tsx b/frontend/src/layout/today/TodaySessionHoverCard.tsx
index 68139d086f6f..86ce14165de9 100644
--- a/frontend/src/layout/today/TodaySessionHoverCard.tsx
+++ b/frontend/src/layout/today/TodaySessionHoverCard.tsx
@@ -1,5 +1,5 @@
import { useActions } from 'kea'
-import { useEffect, useMemo } from 'react'
+import { useMemo } from 'react'
import { IconCopy, IconPinFilled, IconPullRequest } from '@posthog/icons'
import {
@@ -78,28 +78,20 @@ interface TodaySessionHoverCardProps {
preview: TodaySessionPreview
/** Closes the card once an action is chosen. */
onAction: () => void
- /** Keeps the card open while its "File to…" menu is. */
- onSubmenuOpenChange: (open: boolean) => void
}
/**
* A session row's hover card: what the row's marks mean in words, where the work sits, what the agent said last,
* and the row's actions, like PostHog Desktop.
*/
-export function TodaySessionHoverCard({
- preview,
- onAction,
- onSubmenuOpenChange,
-}: TodaySessionHoverCardProps): JSX.Element {
+export function TodaySessionHoverCard({ preview, onAction }: TodaySessionHoverCardProps): JSX.Element {
const { dot, pullRequest, author } = preview
const { requestArchive } = useActions(todaySessionMenuLogic)
useTodayArchiveShortcut(true, () => {
requestArchive(preview.menu.sessionId, preview.menu.menuId, preview.menu.activeRunId)
onAction()
})
- const parts = useMemo(() => cardMenuParts(onAction, onSubmenuOpenChange), [onAction, onSubmenuOpenChange])
- // Base UI reports no close when the submenu unmounts with the card, which would keep the card open for good.
- useEffect(() => () => onSubmenuOpenChange(false), [onSubmenuOpenChange])
+ const parts = useMemo(() => cardMenuParts(onAction), [onAction])
const pullRequestState = pullRequestStateMeta(preview.pullRequestState)
const updated = activityDetail(preview.timestamp)
return (
diff --git a/frontend/src/layout/today/TodaySpaceActions.tsx b/frontend/src/layout/today/TodaySpaceActions.tsx
deleted file mode 100644
index be98e43cbe9f..000000000000
--- a/frontend/src/layout/today/TodaySpaceActions.tsx
+++ /dev/null
@@ -1,84 +0,0 @@
-import { useActions } from 'kea'
-
-import {
- IconArchive,
- IconCopy,
- IconPencil,
- IconPeople,
- IconPlus,
- IconStar,
- IconStarFilled,
- IconTrash,
-} from '@posthog/icons'
-
-import { urls } from 'scenes/urls'
-
-import { ChannelDTOApi } from 'products/tasks/frontend/generated/api.schemas'
-
-import { TodayMenuParts } from './todayMenuParts'
-import { todaySpacesLogic } from './todaySpacesLogic'
-
-interface TodaySpaceActionsProps {
- parts: TodayMenuParts
- space: ChannelDTOApi
- /** Starts each item's `data-attr`, so every surface counts on its own. */
- dataAttrPrefix: string
-}
-
-function autoArchiveActionLabel(days: number | null): string {
- return days === null ? 'Auto-archive: off…' : `Auto-archive: ${days} ${days === 1 ? 'day' : 'days'}…`
-}
-
-/** A space's actions, New session first, like the space rows in PostHog Desktop. */
-export function TodaySpaceActions({
- parts: { Item, Separator },
- space,
- dataAttrPrefix,
-}: TodaySpaceActionsProps): JSX.Element {
- const { toggleStar, copySpaceLink } = useActions(todaySpacesLogic)
- const attr = (name: string): string => `${dataAttrPrefix}-${name}`
- const settingsUrl = urls.taskSpaceSettings(space.id)
- const editable = !space.system_role
-
- return (
- <>
- <Item to={urls.taskSpaceNewSession(space.id)} dataAttr={attr('new-session')}>
- <IconPlus />
- New session
- </Item>
- {space.system_role !== 'personal' && (
- <Item onClick={() => toggleStar(space.id, !space.starred)} dataAttr={attr('star')}>
- {space.starred ? <IconStarFilled /> : <IconStar />}
- {space.starred ? 'Unstar space' : 'Star space'}
- </Item>
- )}
- <Item onClick={() => copySpaceLink(space.id)} dataAttr={attr('copy-link')}>
- <IconCopy />
- Copy link
- </Item>
- <Separator />
- <Item to={settingsUrl} dataAttr={attr('auto-archive')}>
- <IconArchive />
- {autoArchiveActionLabel(space.auto_archive_after_days)}
- </Item>
- {space.channel_type === 'private' && (
- <Item to={settingsUrl} dataAttr={attr('members')}>
- <IconPeople />
- Members
- </Item>
- )}
- {editable && (
- <>
- <Item to={settingsUrl} dataAttr={attr('rename')}>
- <IconPencil />
- Rename space…
- </Item>
- <Item to={settingsUrl} variant="destructive" dataAttr={attr('delete')}>
- <IconTrash />
- Delete space…
- </Item>
- </>
- )}
- </>
- )
-}
diff --git a/frontend/src/layout/today/TodaySpaceContextMenu.tsx b/frontend/src/layout/today/TodaySpaceContextMenu.tsx
deleted file mode 100644
index d53e4947ce96..000000000000
--- a/frontend/src/layout/today/TodaySpaceContextMenu.tsx
+++ /dev/null
@@ -1,51 +0,0 @@
-import { useActions, useValues } from 'kea'
-import { ReactNode, useState } from 'react'
-
-import { ContextMenu, ContextMenuContent, ContextMenuTrigger } from '@posthog/quill'
-
-import { ChannelDTOApi } from 'products/tasks/frontend/generated/api.schemas'
-
-import { CONTEXT_PARTS, SHEET_PARTS } from './todayMenuParts'
-import { useTodayPreviewMenuReport } from './todayPreviewCardContext'
-import { TodaySheetMenu } from './TodaySheetMenu'
-import { todayShellLogic } from './todayShellLogic'
-import { TodaySpaceActions } from './TodaySpaceActions'
-import { spaceLabel, todaySpacesLogic } from './todaySpacesLogic'
-
-/** A space row's actions on right-click, the same list its hover card shows, like PostHog Desktop. */
-export function TodaySpaceContextMenu({ space, children }: { space: ChannelDTOApi; children: ReactNode }): JSX.Element {
- const reportMenuOpen = useTodayPreviewMenuReport()
- const { phoneLayout } = useValues(todayShellLogic)
- const { touchMenuOpened } = useActions(todaySpacesLogic)
- const [sheetOpen, setSheetOpen] = useState(false)
-
- if (phoneLayout) {
- return (
- <>
- <ContextMenu
- open={false}
- onOpenChange={(next) => {
- if (next) {
- setSheetOpen(true)
- touchMenuOpened('space')
- }
- }}
- >
- <ContextMenuTrigger render={<div className="min-w-0" />}>{children}</ContextMenuTrigger>
- </ContextMenu>
- <TodaySheetMenu open={sheetOpen} onOpenChange={setSheetOpen} title={spaceLabel(space)}>
- <TodaySpaceActions parts={SHEET_PARTS} space={space} dataAttrPrefix="today-space-sheet" />
- </TodaySheetMenu>
- </>
- )
- }
-
- return (
- <ContextMenu onOpenChange={reportMenuOpen}>
- <ContextMenuTrigger render={<div className="min-w-0" />}>{children}</ContextMenuTrigger>
- <ContextMenuContent className="w-56">
- <TodaySpaceActions parts={CONTEXT_PARTS} space={space} dataAttrPrefix="today-space-context" />
- </ContextMenuContent>
- </ContextMenu>
- )
-}
diff --git a/frontend/src/layout/today/TodaySpaceFileList.tsx b/frontend/src/layout/today/TodaySpaceFileList.tsx
deleted file mode 100644
index 2013ce2f3a26..000000000000
--- a/frontend/src/layout/today/TodaySpaceFileList.tsx
+++ /dev/null
@@ -1,85 +0,0 @@
-import { useValues } from 'kea'
-import { ChangeEvent, useState } from 'react'
-
-import { IconStar } from '@posthog/icons'
-import { DropdownMenuRadioGroup, DropdownMenuRadioItem, Input, ItemRadio, Text } from '@posthog/quill'
-
-import { useTodaySheetMenu } from './todaySheetMenuContext'
-import { fileToSpaces, spaceLabel, todaySpacesLogic } from './todaySpacesLogic'
-
-/** Desktop's "File to…" list gets a fixed height past this many spaces; the web adds its search there. */
-const SPACE_SEARCH_THRESHOLD = 5
-
-interface TodaySpaceFileListProps {
- /** Ticked and listed first. Null when the sessions being filed have no single space. */
- currentSpaceId: string | null
- onSelect: (spaceId: string) => void
- itemDataAttr: string
- searchDataAttr: string
-}
-
-/** The "File to…" menu body. The menu unmounts it on close, which also clears the search. */
-export function TodaySpaceFileList({
- currentSpaceId,
- onSelect,
- itemDataAttr,
- searchDataAttr,
-}: TodaySpaceFileListProps): JSX.Element {
- const { spaces } = useValues(todaySpacesLogic)
- const [search, setSearch] = useState('')
- const sheet = useTodaySheetMenu()
- const targets = fileToSpaces(spaces, currentSpaceId, search)
-
- return (
- <>
- {spaces.length > SPACE_SEARCH_THRESHOLD && (
- // Keep typing away from the menu's typeahead; Escape still closes the menu.
- <div className="p-1" onKeyDown={(event) => event.key !== 'Escape' && event.stopPropagation()}>
- <Input
- autoFocus={!sheet}
- value={search}
- onChange={(event: ChangeEvent<HTMLInputElement>) => setSearch(event.target.value)}
- placeholder="Search spaces…"
- aria-label="Search spaces"
- data-attr={searchDataAttr}
- />
- </div>
- )}
- {targets.length === 0 && (
- <Text render={<div />} size="sm" variant="muted" className="px-2 py-1.5">
- No spaces match your search
- </Text>
- )}
- {sheet ? (
- targets.map((space) => (
- <ItemRadio
- key={space.id}
- className="flex-nowrap"
- aria-checked={space.id === currentSpaceId}
- onClick={() => {
- onSelect(space.id)
- sheet.close()
- }}
- data-attr={itemDataAttr}
- >
- <span className="truncate">{spaceLabel(space)}</span>
- {space.starred && space.system_role !== 'personal' && (
- <IconStar className="shrink-0 text-muted-foreground" />
- )}
- </ItemRadio>
- ))
- ) : (
- <DropdownMenuRadioGroup value={currentSpaceId ?? ''} onValueChange={(value: string) => onSelect(value)}>
- {targets.map((space) => (
- <DropdownMenuRadioItem key={space.id} value={space.id} closeOnClick data-attr={itemDataAttr}>
- <span className="truncate">{spaceLabel(space)}</span>
- {space.starred && space.system_role !== 'personal' && (
- <IconStar className="ml-auto text-muted-foreground" />
- )}
- </DropdownMenuRadioItem>
- ))}
- </DropdownMenuRadioGroup>
- )}
- </>
- )
-}
diff --git a/frontend/src/layout/today/TodaySpaceHoverCard.tsx b/frontend/src/layout/today/TodaySpaceHoverCard.tsx
deleted file mode 100644
index ffc4e36dd0fa..000000000000
--- a/frontend/src/layout/today/TodaySpaceHoverCard.tsx
+++ /dev/null
@@ -1,105 +0,0 @@
-import { useMemo } from 'react'
-
-import { IconGitRepository } from '@posthog/icons'
-import { Item, ItemActions, ItemContent, ItemDescription, ItemSeparator, ItemTitle, Text } from '@posthog/quill'
-
-import { dayjs } from 'lib/dayjs'
-
-import { SpacePresenceAvatars } from 'products/tasks/frontend/spaces/SpacePresenceAvatars'
-
-import { cardMenuParts } from './todayMenuParts'
-import { TodaySpaceKind, TodaySpacePreview } from './todayPreviewCards'
-import { TodaySpaceActions } from './TodaySpaceActions'
-import { TodaySpaceGlyph } from './TodaySpaceGlyph'
-
-const KIND_LABELS: Record<TodaySpaceKind, string> = {
- public: 'Space',
- private: 'Private space',
- personal: 'Personal space',
-}
-
-// A space's actions open no submenu, so nothing has to hold the card open.
-const NO_SUBMENU = (): void => {}
-
-/**
- * A space row's hover card: what kind of space it is, who works in it, which repositories it uses, and its actions.
- * Like PostHog Desktop, the row itself carries no buttons, so New session leads the list here.
- */
-export function TodaySpaceHoverCard({
- preview,
- onAction,
-}: {
- preview: TodaySpacePreview
- /** Closes the card once an action is chosen. */
- onAction: () => void
-}): JSX.Element {
- const parts = useMemo(() => cardMenuParts(onAction, NO_SUBMENU), [onAction])
- return (
- <div className="flex flex-col" data-attr="today-space-hover-card">
- {/* `flex-nowrap` keeps the faces beside a long name. */}
- <Item size="xs" className="flex-nowrap items-start">
- <ItemContent className="min-w-0">
- {/* `wrap-anywhere`: the title sizes to its content, so a long name would widen the card. */}
- <ItemTitle className="flex items-center gap-2 wrap-anywhere">
- <span className="flex size-3.5 shrink-0 items-center justify-center text-muted-foreground">
- <TodaySpaceGlyph locked={preview.spaceKind !== 'public'} />
- </span>
- <span className="min-w-0 font-semibold">{preview.name}</span>
- {preview.unreadSessions > 0 && (
- <span aria-hidden className="size-2 shrink-0 rounded-full bg-primary" />
- )}
- </ItemTitle>
- <ItemDescription className="pl-5.5">
- <span className="block">{KIND_LABELS[preview.spaceKind]}</span>
- {preview.lastActivityAt && (
- <span className="block">{`Active ${dayjs(preview.lastActivityAt).fromNow()}`}</span>
- )}
- </ItemDescription>
- </ItemContent>
- <ItemActions className="self-start">
- <SpacePresenceAvatars
- presence={{ people: preview.people, liveUuids: preview.liveUuids }}
- creatorUuid={preview.creatorUuid}
- />
- </ItemActions>
- </Item>
- {(preview.unreadSessions > 0 || preview.repositories.length > 0) && (
- <>
- <ItemSeparator className="my-0" />
- <Item size="xs">
- <ItemContent className="min-w-0 gap-1.5">
- {preview.unreadSessions > 0 && (
- <span className="flex items-center gap-1 text-xs text-muted-foreground">
- <span aria-hidden className="size-2 shrink-0 rounded-full bg-primary" />
- {`${preview.unreadSessions} unread`}
- </span>
- )}
- {preview.repositories.length > 0 && (
- <div className="flex flex-wrap items-center gap-x-3 gap-y-1">
- {preview.repositories.map((repository) => (
- <span
- key={repository}
- className="flex min-w-0 items-center gap-1 text-xs text-muted-foreground"
- >
- <IconGitRepository className="size-3 shrink-0" />
- <span className="truncate">{repository}</span>
- </span>
- ))}
- {preview.hiddenRepositoryCount > 0 && (
- <Text size="xs" variant="muted" render={<span />}>
- {`+${preview.hiddenRepositoryCount} more`}
- </Text>
- )}
- </div>
- )}
- </ItemContent>
- </Item>
- </>
- )}
- <ItemSeparator className="my-0" />
- <div className="flex flex-col p-1">
- <TodaySpaceActions parts={parts} space={preview.space} dataAttrPrefix="today-space-card" />
- </div>
- </div>
- )
-}
diff --git a/frontend/src/layout/today/todayMenuParts.tsx b/frontend/src/layout/today/todayMenuParts.tsx
index b32ee9575d7b..b8d5fb81a2e5 100644
--- a/frontend/src/layout/today/todayMenuParts.tsx
+++ b/frontend/src/layout/today/todayMenuParts.tsx
@@ -137,10 +137,9 @@ export const SHEET_PARTS: TodayMenuParts = {
/**
* The parts for a hover card's action list. The card is not a menu, so its rows are plain buttons.
- * `onAction` closes the card after a choice. `onSubmenuOpenChange` reports "File to…", whose menu opens
- * outside the card, so the card stays open while the pointer is in it. Desktop drops the separators here.
+ * `onAction` closes the card after a choice. Desktop drops the separators here.
*/
-export function cardMenuParts(onAction: () => void, onSubmenuOpenChange: (open: boolean) => void): TodayMenuParts {
+export function cardMenuParts(onAction: () => void): TodayMenuParts {
return {
Item: ({ children, dataAttr, onClick, to, disabled, variant }) => (
<Button
@@ -163,7 +162,6 @@ export function cardMenuParts(onAction: () => void, onSubmenuOpenChange: (open:
Sub: ({ label, dataAttr, children }) => (
<DropdownMenu
onOpenChange={(open, details) => {
- onSubmenuOpenChange(open)
if (!open && details.reason === 'item-press') {
onAction()
}
diff --git a/frontend/src/layout/today/todayPreviewCards.test.ts b/frontend/src/layout/today/todayPreviewCards.test.ts
index 5448f5ad01be..62755b4279df 100644
--- a/frontend/src/layout/today/todayPreviewCards.test.ts
+++ b/frontend/src/layout/today/todayPreviewCards.test.ts
@@ -1,59 +1,11 @@
import { ConversationDetail } from '~/types'
-import { ChannelDTOApi, TaskListItemApi, TaskUserBasicInfoApi } from 'products/tasks/frontend/generated/api.schemas'
+import { TaskListItemApi } from 'products/tasks/frontend/generated/api.schemas'
-import { chatPreview, sessionPreview, spaceKind, spacePreview } from './todayPreviewCards'
+import { chatPreview, sessionPreview } from './todayPreviewCards'
import { chatItem, sessionItem } from './todayWorkItems'
-const person = (uuid: string): TaskUserBasicInfoApi => ({
- id: uuid.length,
- uuid,
- distinct_id: uuid,
- first_name: uuid,
- last_name: '',
- email: `${uuid}@example.com`,
-})
-
-const space = (overrides: Partial<ChannelDTOApi>): ChannelDTOApi =>
- ({ id: 'space-a', name: 'checkout', channel_type: 'public', repositories: [], ...overrides }) as ChannelDTOApi
-
describe('todayPreviewCards', () => {
- it.each<[string, Partial<ChannelDTOApi>, ReturnType<typeof spaceKind>]>([
- [
- 'the personal space, whatever its channel type',
- { system_role: 'personal', channel_type: 'public' },
- 'personal',
- ],
- ['a private space', { channel_type: 'private', system_role: null }, 'private'],
- ['the general space', { channel_type: 'public', system_role: 'general' }, 'public'],
- ])('names %s', (_name, identity, kind) => {
- expect(spaceKind(space(identity))).toBe(kind)
- })
-
- it.each<[string, TaskUserBasicInfoApi | null, string[], string[]]>([
- ['leads with a creator who was not active lately', person('ada'), ['grace'], ['ada', 'grace']],
- ['lists a creator who was also active once', person('ada'), ['grace', 'ada'], ['ada', 'grace']],
- ['shows only recent people when the creator is unknown', null, ['grace'], ['grace']],
- ])('space people %s', (_name, creator, recent, expected) => {
- const preview = spacePreview(
- space({ created_by: creator }),
- 'checkout',
- { people: recent.map(person), liveUuids: [] },
- undefined
- )
- expect(preview.people.map((p) => p.uuid)).toEqual(expected)
- })
-
- it('names three repositories and counts the rest', () => {
- const preview = spacePreview(
- space({ repositories: ['a/1', 'a/2', 'a/3', 'a/4', 'a/5'] }),
- 'checkout',
- undefined,
- undefined
- )
- expect([preview.repositories, preview.hiddenRepositoryCount]).toEqual([['a/1', 'a/2', 'a/3'], 2])
- })
-
it.each<[string, string | null, Record<string, string>, string | null]>([
['names the space the session is in', 'space-a', { 'space-a': 'checkout' }, 'checkout'],
['leaves out a space the rail has not loaded', 'space-gone', { 'space-a': 'checkout' }, null],
diff --git a/frontend/src/layout/today/todayPreviewCards.ts b/frontend/src/layout/today/todayPreviewCards.ts
index b6da6051745f..efab36e65d4b 100644
--- a/frontend/src/layout/today/todayPreviewCards.ts
+++ b/frontend/src/layout/today/todayPreviewCards.ts
@@ -1,18 +1,12 @@
import { getOriginProductMeta } from 'products/posthog_ai/frontend/api/taskSource'
import type { ReportChartApi, ReportMetricApi } from 'products/signals/frontend/generated/api.schemas'
-import { ChannelDTOApi, PrStateEnumApi, TaskUserBasicInfoApi } from 'products/tasks/frontend/generated/api.schemas'
-import { SpacePresence } from 'products/tasks/frontend/spaces/spacePresence'
+import { PrStateEnumApi, TaskUserBasicInfoApi } from 'products/tasks/frontend/generated/api.schemas'
import { TaskPullRequest } from 'products/tasks/frontend/spaces/taskPullRequests'
import { recentSourceLabel } from './todayRecentFilters'
import { TodaySessionDot, todaySessionDot } from './todaySessionDot'
import { TodaySessionMenuTarget, TodayWorkItem, sessionMenuTarget } from './todayWorkItems'
-/** Repositories past this are counted rather than named, so the card stays a glance. */
-const SPACE_PREVIEW_REPOSITORY_LIMIT = 3
-
-export type TodaySpaceKind = 'public' | 'private' | 'personal'
-
/** What a session row's hover card says, built once per row so the shared card gets a stable payload. */
export interface TodaySessionPreview {
kind: 'session'
@@ -34,23 +28,6 @@ export interface TodaySessionPreview {
menu: TodaySessionMenuTarget
}
-/** What a space row's hover card says. */
-export interface TodaySpacePreview {
- kind: 'space'
- /** What the card's actions act on. */
- space: ChannelDTOApi
- name: string
- spaceKind: TodaySpaceKind
- /** The creator first, then whoever worked in the space most recently. */
- people: TaskUserBasicInfoApi[]
- liveUuids: string[]
- creatorUuid: string | null
- lastActivityAt: string | null
- unreadSessions: number
- repositories: string[]
- hiddenRepositoryCount: number
-}
-
export interface TodayChatPreview {
kind: 'chat'
chatId: string
@@ -93,14 +70,7 @@ export interface TodayReportPreview {
surface: 'briefing' | 'sidebar'
}
-export type TodayPreviewPayload = TodaySessionPreview | TodaySpacePreview | TodayChatPreview | TodayReportPreview
-
-export function spaceKind(space: Pick<ChannelDTOApi, 'channel_type' | 'system_role'>): TodaySpaceKind {
- if (space.system_role === 'personal' || space.channel_type === 'personal') {
- return 'personal'
- }
- return space.channel_type === 'private' ? 'private' : 'public'
-}
+export type TodayPreviewPayload = TodaySessionPreview | TodayChatPreview | TodayReportPreview
export function sessionPreview(
item: TodayWorkItem,
@@ -142,23 +112,6 @@ export function sessionPreview(
}
}
-/**
- * The creator leads whether or not they worked here lately, so the crown always sits on the first face.
- * They are not listed twice when they are also in the recent people.
- */
-function spacePeople(
- creator: TaskUserBasicInfoApi | null | undefined,
- presence: SpacePresence | undefined
-): TaskUserBasicInfoApi[] {
- const people = creator ? [creator] : []
- for (const person of presence?.people ?? []) {
- if (!people.some((existing) => existing.uuid === person.uuid)) {
- people.push(person)
- }
- }
- return people
-}
-
export function chatPreview(item: TodayWorkItem): TodayChatPreview {
return {
kind: 'chat',
@@ -168,25 +121,3 @@ export function chatPreview(item: TodayWorkItem): TodayChatPreview {
timestamp: item.timestamp,
}
}
-
-export function spacePreview(
- space: ChannelDTOApi,
- name: string,
- presence: SpacePresence | undefined,
- lastActivityAt: string | undefined,
- unreadSessions: number = 0
-): TodaySpacePreview {
- return {
- kind: 'space',
- space,
- name,
- spaceKind: spaceKind(space),
- people: spacePeople(space.created_by, presence),
- liveUuids: presence?.liveUuids ?? [],
- creatorUuid: space.created_by?.uuid ?? null,
- lastActivityAt: lastActivityAt ?? null,
- unreadSessions,
- repositories: space.repositories.slice(0, SPACE_PREVIEW_REPOSITORY_LIMIT),
- hiddenRepositoryCount: Math.max(0, space.repositories.length - SPACE_PREVIEW_REPOSITORY_LIMIT),
- }
-}
diff --git a/frontend/src/layout/today/todaySessionBulkRequests.ts b/frontend/src/layout/today/todaySessionBulkRequests.ts
index 5feded4bfce6..6736ff216e8e 100644
--- a/frontend/src/layout/today/todaySessionBulkRequests.ts
+++ b/frontend/src/layout/today/todaySessionBulkRequests.ts
@@ -25,10 +25,6 @@ export function pinSessions(teamId: string, ids: string[], pinned: boolean): Pro
return runEach(ids, (id) => tasksPinCreate(teamId, id, { pinned }))
}
-export function fileSessions(teamId: string, ids: string[], spaceId: string): Promise<string[]> {
- return runEach(ids, (id) => tasksPartialUpdate(teamId, id, { channel: spaceId }))
-}
-
export function archiveSessions(teamId: string, sessions: TodayWorkItem[]): Promise<string[]> {
const runIds = new Map(sessions.map((item) => [item.id, activeCloudRunId(item)]))
return runEach([...runIds.keys()], async (id) => {
diff --git a/frontend/src/layout/today/todaySessionMenuLogic.ts b/frontend/src/layout/today/todaySessionMenuLogic.ts
index 8b537b7b0185..b88b124a7ac3 100644
--- a/frontend/src/layout/today/todaySessionMenuLogic.ts
+++ b/frontend/src/layout/today/todaySessionMenuLogic.ts
@@ -90,13 +90,6 @@ export interface todaySessionMenuLogicActions {
sessionId: string
user: UserBasicType
}
- moveSession: (
- sessionId: string,
- spaceId: string
- ) => {
- sessionId: string
- spaceId: string
- }
openHandoff: (menuId: string) => {
menuId: string
}
@@ -178,7 +171,6 @@ export const todaySessionMenuLogic = kea<todaySessionMenuLogicType>([
setSessionPinned: (sessionId: string, pinned: boolean) => ({ sessionId, pinned }),
renameSession: (sessionId: string, title: string) => ({ sessionId, title }),
archiveSession: (sessionId: string, archived: boolean) => ({ sessionId, archived }),
- moveSession: (sessionId: string, spaceId: string) => ({ sessionId, spaceId }),
sessionUpdated: (sessionId: string) => ({ sessionId }),
sessionUpdateFailed: (sessionId: string) => ({ sessionId }),
startRenaming: (sessionId: string, surface: TodaySessionSurface) => ({ sessionId, surface }),
@@ -237,7 +229,6 @@ export const todaySessionMenuLogic = kea<todaySessionMenuLogicType>([
setSessionPinned: (state, { sessionId }) => [...state, sessionId],
renameSession: (state, { sessionId }) => [...state, sessionId],
archiveSession: (state, { sessionId }) => [...state, sessionId],
- moveSession: (state, { sessionId }) => [...state, sessionId],
handOffSession: (state, { sessionId }) => [...state, sessionId],
analyzeSession: (state, { sessionId }) => [...state, sessionId],
stopSession: (state, { sessionId }) => [...state, sessionId],
@@ -346,9 +337,6 @@ export const todaySessionMenuLogic = kea<todaySessionMenuLogicType>([
toast.error({ title: 'Couldn’t copy the link. Try again.' })
}
},
- moveSession: async ({ sessionId, spaceId }) => {
- await update(sessionId, { channel: spaceId }, 'Couldn’t move this session. Try again.')
- },
handOffSession: async ({ sessionId, user }) => {
try {
await tasksHandoffCreate(String(values.currentTeamId), sessionId, { user: user.id })
diff --git a/frontend/src/layout/today/todaySessionSelection.ts b/frontend/src/layout/today/todaySessionSelection.ts
index 1688d4fe3dcd..af2a1b94bfd1 100644
--- a/frontend/src/layout/today/todaySessionSelection.ts
+++ b/frontend/src/layout/today/todaySessionSelection.ts
@@ -9,12 +9,11 @@ export interface TodaySessionSelection {
export type TodaySelectionClick = 'toggle' | 'range' | 'open'
-export type TodayBulkVerb = 'pin' | 'unpin' | 'file' | 'archive' | 'restore'
+export type TodayBulkVerb = 'pin' | 'unpin' | 'archive' | 'restore'
const PAST_TENSE: Record<TodayBulkVerb, string> = {
pin: 'pinned',
unpin: 'unpinned',
- file: 'filed',
archive: 'archived',
restore: 'restored',
}
diff --git a/frontend/src/layout/today/todaySessionSelectionLogic.test.ts b/frontend/src/layout/today/todaySessionSelectionLogic.test.ts
index f8dc22758c0a..d6e9885c6b16 100644
--- a/frontend/src/layout/today/todaySessionSelectionLogic.test.ts
+++ b/frontend/src/layout/today/todaySessionSelectionLogic.test.ts
@@ -84,7 +84,6 @@ describe('todaySessionSelectionLogic', () => {
it.each([
['pin', () => logic.actions.pinSelected()],
- ['file', () => logic.actions.fileSelectedTo('space-1')],
['archive', () => logic.actions.requestBulkArchive()],
])('keeps only the failed sessions selected and shows one toast when a bulk %s partly fails', async (_, run) => {
failingId = 'task-b'
diff --git a/frontend/src/layout/today/todaySessionSelectionLogic.ts b/frontend/src/layout/today/todaySessionSelectionLogic.ts
index 3547c9e5a08e..0f721bda4a75 100644
--- a/frontend/src/layout/today/todaySessionSelectionLogic.ts
+++ b/frontend/src/layout/today/todaySessionSelectionLogic.ts
@@ -5,13 +5,7 @@ import type { LocationChangedPayload } from 'kea-router/lib/types'
import { teamLogic } from 'scenes/teamLogic'
import { TodayRecentSection } from './todayRecentOrder'
-import {
- archiveSessions,
- fileSessions,
- pinSessions,
- reportBulkResult,
- restoreSessions,
-} from './todaySessionBulkRequests'
+import { archiveSessions, pinSessions, reportBulkResult, restoreSessions } from './todaySessionBulkRequests'
import {
EMPTY_SELECTION,
TodaySessionSelection,
@@ -27,7 +21,7 @@ import { todayShellLogic } from './todayShellLogic'
import { TodayWorkSectionId, todaySpacesLogic } from './todaySpacesLogic'
import { TodayWorkItem, activeCloudRunId } from './todayWorkItems'
-export type TodayBulkAction = 'pin' | 'file' | 'archive'
+export type TodayBulkAction = 'pin' | 'archive'
/** Counted when the confirm opens, so the closing dialog doesn't retitle itself as the selection clears. */
export interface TodayBulkArchiveConfirm {
@@ -92,9 +86,6 @@ export interface todaySessionSelectionLogicActions {
closeBulkArchiveConfirm: () => {
value: true
}
- fileSelectedTo: (spaceId: string) => {
- spaceId: string
- }
openBulkArchiveConfirm: (
count: number,
running: number
@@ -168,7 +159,6 @@ export const todaySessionSelectionLogic = kea<todaySessionSelectionLogicType>([
selectSessionRange: (sessionId: string) => ({ sessionId }),
clearSelection: true,
pinSelected: true,
- fileSelectedTo: (spaceId: string) => ({ spaceId }),
requestBulkArchive: true,
openBulkArchiveConfirm: (count: number, running: number) => ({ count, running }),
closeBulkArchiveConfirm: true,
@@ -193,7 +183,6 @@ export const todaySessionSelectionLogic = kea<todaySessionSelectionLogicType>([
null as TodayBulkAction | null,
{
pinSelected: () => 'pin',
- fileSelectedTo: () => 'file',
archiveSelected: () => 'archive',
bulkActionFinished: () => null,
},
@@ -285,12 +274,6 @@ export const todaySessionSelectionLogic = kea<todaySessionSelectionLogicType>([
reportBulkResult(pinned ? 'pin' : 'unpin', ids.length, failed.length)
finish(failed)
},
- fileSelectedTo: async ({ spaceId }) => {
- const ids = values.selectedSessionIds
- const failed = await fileSessions(teamId(), ids, spaceId)
- reportBulkResult('file', ids.length, failed.length)
- finish(failed)
- },
requestBulkArchive: () => {
if (values.runningSelectedCount > 0) {
actions.openBulkArchiveConfirm(values.selectedSessionIds.length, values.runningSelectedCount)
diff --git a/frontend/src/layout/today/todaySpacesLogic.ts b/frontend/src/layout/today/todaySpacesLogic.ts
index ecbd2029136e..d46390686c27 100644
--- a/frontend/src/layout/today/todaySpacesLogic.ts
+++ b/frontend/src/layout/today/todaySpacesLogic.ts
@@ -110,20 +110,6 @@ export function starredSpaces(spaces: ChannelDTOApi[]): ChannelDTOApi[] {
]
}
-/** The spaces a session can be filed to: its current space first, then starred spaces, then the rest by name. */
-export function fileToSpaces(spaces: ChannelDTOApi[], currentSpaceId: string | null, search = ''): ChannelDTOApi[] {
- const query = search.trim().toLowerCase()
- const starred = starredSpaces(spaces)
- const ordered = [
- ...spaces.filter((space) => space.id === currentSpaceId),
- ...starred.filter((space) => space.id !== currentSpaceId),
- ...spaces
- .filter((space) => space.id !== currentSpaceId && !starred.includes(space))
- .sort((first, second) => first.name.localeCompare(second.name)),
- ]
- return query ? ordered.filter((space) => spaceLabel(space).toLowerCase().includes(query)) : ordered
-}
-
// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
export interface todaySpacesLogicValues {
conversationHistory: ConversationDetail[] // maxGlobalLogic
diff --git a/frontend/src/layout/today/todayWorkItems.test.ts b/frontend/src/layout/today/todayWorkItems.test.ts
index c68aff407b55..b499fb89338d 100644
--- a/frontend/src/layout/today/todayWorkItems.test.ts
+++ b/frontend/src/layout/today/todayWorkItems.test.ts
@@ -2,7 +2,7 @@ import { dayjs } from 'lib/dayjs'
import { ConversationDetail } from '~/types'
-import { TaskActivityDTOApi, TaskListItemApi } from 'products/tasks/frontend/generated/api.schemas'
+import { TaskListItemApi } from 'products/tasks/frontend/generated/api.schemas'
import { TodayListItemField } from './todayListAppearance'
import {
@@ -23,7 +23,6 @@ import {
sessionDetails,
sessionItem,
shortTimeAgo,
- unreadSessionCountsBySpace,
} from './todayWorkItems'
const session = (id: string, lastActivityAt: string, archived = false): TaskListItemApi =>
@@ -32,19 +31,6 @@ const session = (id: string, lastActivityAt: string, archived = false): TaskList
const chat = (id: string, updatedAt: string): ConversationDetail =>
({ id, title: `Chat ${id}`, updated_at: updatedAt, created_at: updatedAt }) as ConversationDetail
-const activity = (
- taskId: string | null,
- channelId: string | null,
- overrides: Partial<TaskActivityDTOApi> = {}
-): TaskActivityDTOApi =>
- ({
- id: `${taskId}-${overrides.latest_comment_id ?? 'run'}`,
- task_id: taskId,
- channel_id: channelId,
- is_unread: true,
- ...overrides,
- }) as TaskActivityDTOApi
-
const ME = 7
const mixedItems = [
@@ -314,31 +300,6 @@ describe('todayWorkItems', () => {
expect(item.finalMessage).toBe(message)
})
- it.each<[string, TaskActivityDTOApi[], Record<string, number>]>([
- [
- 'counts each unread session once per space',
- [
- activity('s1', 'space-a'),
- activity('s1', 'space-a'),
- activity('s2', 'space-a'),
- activity('s3', 'space-b'),
- ],
- { 'space-a': 2, 'space-b': 1 },
- ],
- [
- 'skips read sessions, comment notifications and sessions outside a space',
- [
- activity('s1', 'space-a', { is_unread: false }),
- activity('s2', 'space-a', { latest_comment_id: 'comment-1' }),
- activity('s3', null),
- activity(null, 'space-a'),
- ],
- {},
- ],
- ])('unread session counts %s', (_name, rows, expected) => {
- expect(unreadSessionCountsBySpace(rows)).toEqual(expected)
- })
-
it.each<[string, Partial<TaskListItemApi>, TodayListItemField[], string[]]>([
[
'the chosen details in the chosen order',
diff --git a/frontend/src/layout/today/todayWorkItems.ts b/frontend/src/layout/today/todayWorkItems.ts
index 42cbc1cf37cc..4e25f0a16c1b 100644
--- a/frontend/src/layout/today/todayWorkItems.ts
+++ b/frontend/src/layout/today/todayWorkItems.ts
@@ -266,21 +266,6 @@ export function unreadSessionIds(activity: TaskActivityDTOApi[]): Set<string> {
return new Set(unreadSessionActivity(activity).map((row) => row.task_id as string))
}
-export function unreadSpaceIds(activity: TaskActivityDTOApi[]): Set<string> {
- return new Set(unreadSessionActivity(activity).flatMap((row) => (row.channel_id ? [row.channel_id] : [])))
-}
-
-export function unreadSessionCountsBySpace(activity: TaskActivityDTOApi[]): Record<string, number> {
- const sessionsBySpace: Record<string, Set<string>> = {}
- for (const row of unreadSessionActivity(activity)) {
- if (row.channel_id) {
- sessionsBySpace[row.channel_id] ??= new Set()
- sessionsBySpace[row.channel_id].add(row.task_id as string)
- }
- }
- return Object.fromEntries(Object.entries(sessionsBySpace).map(([spaceId, sessions]) => [spaceId, sessions.size]))
-}
-
/**
* What to send to mark a session read, or null when it has nothing unread.
* `seen_before` is never earlier than the newest activity shown, so a client clock behind the server's still clears it.
diff --git a/frontend/src/layout/today/useTodaySidebarBulkSelection.ts b/frontend/src/layout/today/useTodaySidebarBulkSelection.ts
index 17f7e18f671a..5f532fd5e9f3 100644
--- a/frontend/src/layout/today/useTodaySidebarBulkSelection.ts
+++ b/frontend/src/layout/today/useTodaySidebarBulkSelection.ts
@@ -6,15 +6,13 @@ import { todaySessionSelectionLogic } from './todaySessionSelectionLogic'
export function useTodaySidebarBulkSelection(): TodayBulkSelection {
const { selectedSessionIds, bulkPinDirection, bulkAction, runningSelectedCount } =
useValues(todaySessionSelectionLogic)
- const { pinSelected, fileSelectedTo, requestBulkArchive } = useActions(todaySessionSelectionLogic)
+ const { pinSelected, requestBulkArchive } = useActions(todaySessionSelectionLogic)
return {
- spaceId: null,
selectedSessionIds,
bulkPinDirection,
bulkAction,
runningSelectedCount,
pinSelected,
- fileSelectedTo,
requestBulkArchive,
}
}
diff --git a/frontend/src/scenes/project-homepage/today/Today.stories.tsx b/frontend/src/scenes/project-homepage/today/Today.stories.tsx
index 586f71f502b0..d9dfd54d4d12 100644
--- a/frontend/src/scenes/project-homepage/today/Today.stories.tsx
+++ b/frontend/src/scenes/project-homepage/today/Today.stories.tsx
@@ -12,11 +12,10 @@ import { TodayReportHoverCard } from 'scenes/project-homepage/today/TodayReportH
import { urls } from 'scenes/urls'
import { todayListAppearanceLogic } from '~/layout/today/todayListAppearanceLogic'
-import { sessionPreview, spacePreview } from '~/layout/today/todayPreviewCards'
+import { sessionPreview } from '~/layout/today/todayPreviewCards'
import { DEFAULT_RECENT_FILTERS } from '~/layout/today/todayRecentFilters'
import { TodaySessionHoverCard } from '~/layout/today/TodaySessionHoverCard'
import { todaySessionSelectionLogic } from '~/layout/today/todaySessionSelectionLogic'
-import { TodaySpaceHoverCard } from '~/layout/today/TodaySpaceHoverCard'
import { todaySpacesLogic } from '~/layout/today/todaySpacesLogic'
import { sessionItem } from '~/layout/today/todayWorkItems'
import { mswDecorator } from '~/mocks/browser'
@@ -28,7 +27,7 @@ import {
reportMetricsFixture,
} from 'products/signals/frontend/inbox/__mocks__/reportMetricMocks'
import { SignalReportStatus } from 'products/signals/frontend/inbox/types'
-import { ChannelDTOApi, TaskListItemApi } from 'products/tasks/frontend/generated/api.schemas'
+import { TaskListItemApi } from 'products/tasks/frontend/generated/api.schemas'
import type { ReportPageApi } from 'products/today/frontend/generated/api.schemas'
import type { BriefingApi, BriefingItemApi } from 'products/today/frontend/generated/api.schemas'
@@ -1056,26 +1055,6 @@ export const SessionHoverCard: Story = {
}
)}
onAction={noop}
- onSubmenuOpenChange={noop}
- />
- </HoverCardFrame>
- ),
-}
-
-export const SpaceHoverCard: Story = {
- render: () => (
- <HoverCardFrame>
- <TodaySpaceHoverCard
- preview={spacePreview(
- {
- ...SPACES[2],
- repositories: ['example-org/web', 'example-org/billing', 'example-org/api', 'example-org/docs'],
- } as ChannelDTOApi,
- 'checkout',
- { people: [GRACE, ADA], liveUuids: [GRACE.uuid] },
- '2026-09-28T18:28:00Z'
- )}
- onAction={noop}
/>
</HoverCardFrame>
),
diff --git a/products/tasks/frontend/spaces/SpaceFeedSelectionBar.tsx b/products/tasks/frontend/spaces/SpaceFeedSelectionBar.tsx
index 52dd33ba76c2..a33c628c2c5b 100644
--- a/products/tasks/frontend/spaces/SpaceFeedSelectionBar.tsx
+++ b/products/tasks/frontend/spaces/SpaceFeedSelectionBar.tsx
@@ -1,23 +1,11 @@
import { useActions, useValues } from 'kea'
-import { IconArchive, IconFolder, IconPin, IconPinFilled, IconX } from '@posthog/icons'
-import {
- Button,
- Checkbox,
- DropdownMenu,
- DropdownMenuContent,
- DropdownMenuTrigger,
- Text,
- Tooltip,
- TooltipContent,
- TooltipTrigger,
-} from '@posthog/quill'
+import { IconArchive, IconPin, IconPinFilled, IconX } from '@posthog/icons'
+import { Button, Checkbox, Text, Tooltip, TooltipContent, TooltipTrigger } from '@posthog/quill'
import { TodaySessionBulkArchiveDialog } from '~/layout/today/TodaySessionBulkArchiveDialog'
import { sessionsLabel } from '~/layout/today/todaySessionSelection'
import { TodayBulkAction } from '~/layout/today/todaySessionSelectionLogic'
-import { TodaySpaceFileList } from '~/layout/today/TodaySpaceFileList'
-import { todaySpacesLogic } from '~/layout/today/todaySpacesLogic'
import { spaceFeedSelectionLogic } from './spaceFeedSelectionLogic'
@@ -29,12 +17,10 @@ interface BulkButtonProps {
action: TodayBulkAction
icon: JSX.Element
dataAttr: string
- onClick?: () => void
- /** Wraps the button before the tooltip does, so it can open a menu. */
- wrap?: (button: JSX.Element) => JSX.Element
+ onClick: () => void
}
-function BulkButton({ spaceId, label, action, icon, dataAttr, onClick, wrap }: BulkButtonProps): JSX.Element {
+function BulkButton({ spaceId, label, action, icon, dataAttr, onClick }: BulkButtonProps): JSX.Element {
const { bulkAction } = useValues(spaceFeedSelectionLogic({ id: spaceId }))
const loading = bulkAction === action
const busy = bulkAction !== null && !loading
@@ -43,7 +29,7 @@ function BulkButton({ spaceId, label, action, icon, dataAttr, onClick, wrap }: B
)
return (
<Tooltip disabled={!busy}>
- <TooltipTrigger delay={0} render={wrap ? wrap(button) : button}>
+ <TooltipTrigger delay={0} render={button}>
{icon}
{label}
</TooltipTrigger>
@@ -59,13 +45,11 @@ export function SpaceFeedSelectionBar({ spaceId }: { spaceId: string }): JSX.Ele
const {
toggleSelectAll,
pinSelected,
- fileSelectedTo,
requestBulkArchive,
clearSelection,
closeBulkArchiveConfirm,
archiveSelected,
} = useActions(logic)
- const { spaces } = useValues(todaySpacesLogic)
const count = selectedSessionIds.length
const pin = bulkPinDirection === 'pin'
@@ -106,26 +90,6 @@ export function SpaceFeedSelectionBar({ spaceId }: { spaceId: string }): JSX.Ele
onClick={pinSelected}
dataAttr="today-space-feed-bulk-pin"
/>
- {spaces.length > 1 && (
- <DropdownMenu>
- <BulkButton
- spaceId={spaceId}
- label="File to…"
- action="file"
- icon={<IconFolder />}
- wrap={(button) => <DropdownMenuTrigger render={button} />}
- dataAttr="today-space-feed-bulk-file"
- />
- <DropdownMenuContent align="end" className="max-h-80 w-64">
- <TodaySpaceFileList
- currentSpaceId={spaceId}
- onSelect={fileSelectedTo}
- itemDataAttr="today-space-feed-bulk-file-space"
- searchDataAttr="today-space-feed-bulk-file-search"
- />
- </DropdownMenuContent>
- </DropdownMenu>
- )}
<BulkButton
spaceId={spaceId}
label="Archive"
diff --git a/products/tasks/frontend/spaces/spaceFeedSelectionLogic.ts b/products/tasks/frontend/spaces/spaceFeedSelectionLogic.ts
index ac2c7c1d42c5..3190b190d3a2 100644
--- a/products/tasks/frontend/spaces/spaceFeedSelectionLogic.ts
+++ b/products/tasks/frontend/spaces/spaceFeedSelectionLogic.ts
@@ -17,7 +17,6 @@ import type { LocationChangedPayload } from 'kea-router/lib/types'
import {
archiveSessions,
- fileSessions,
pinSessions,
reportBulkResult,
restoreSessions,
@@ -116,9 +115,6 @@ export interface spaceFeedSelectionLogicActions {
closeBulkArchiveConfirm: () => {
value: true
}
- fileSelectedTo: (spaceId: string) => {
- spaceId: string
- }
openBulkArchiveConfirm: (
count: number,
running: number
@@ -195,7 +191,6 @@ export const spaceFeedSelectionLogic: LogicWrapper<spaceFeedSelectionLogicType>
toggleSelectAll: true,
clearSelection: true,
pinSelected: true,
- fileSelectedTo: (spaceId: string) => ({ spaceId }),
requestBulkArchive: true,
openBulkArchiveConfirm: (count: number, running: number) => ({ count, running }),
closeBulkArchiveConfirm: true,
@@ -224,7 +219,6 @@ export const spaceFeedSelectionLogic: LogicWrapper<spaceFeedSelectionLogicType>
null as TodayBulkAction | null,
{
pinSelected: () => 'pin',
- fileSelectedTo: () => 'file',
archiveSelected: () => 'archive',
bulkActionFinished: () => null,
},
@@ -307,12 +301,6 @@ export const spaceFeedSelectionLogic: LogicWrapper<spaceFeedSelectionLogicType>
reportBulkResult(pinned ? 'pin' : 'unpin', ids.length, failed.length)
finish(failed)
},
- fileSelectedTo: async ({ spaceId }) => {
- const ids = values.selectedSessionIds
- const failed = await fileSessions(teamId(), ids, spaceId)
- reportBulkResult('file', ids.length, failed.length)
- finish(failed)
- },
requestBulkArchive: () => {
if (values.runningSelectedCount > 0) {
actions.openBulkArchiveConfirm(values.selectedSessionIds.length, values.runningSelectedCount)
diff --git a/products/tasks/frontend/spaces/spaceSceneLogic.test.ts b/products/tasks/frontend/spaces/spaceSceneLogic.test.ts
index 32c4dde7a598..2ac0aa929efd 100644
--- a/products/tasks/frontend/spaces/spaceSceneLogic.test.ts
+++ b/products/tasks/frontend/spaces/spaceSceneLogic.test.ts
@@ -5,7 +5,6 @@ import { expectLogic } from 'kea-test-utils'
import { urls } from 'scenes/urls'
-import { todaySessionMenuLogic } from '~/layout/today/todaySessionMenuLogic'
import { todaySpacesLogic } from '~/layout/today/todaySpacesLogic'
import { useMocks } from '~/mocks/jest'
import { initKeaTests } from '~/test/init'
@@ -161,18 +160,6 @@ describe('spaceSceneLogic', () => {
return logic
}
- it('drops a session from the feed when the row menu moves it to another space', async () => {
- const logic = spaceSceneLogic({ id: 'space-a' })
- logic.mount()
- await expectLogic(logic).toFinishAllListeners()
- expect(logic.values.feedItems.map((item) => item.id)).toEqual(['task-1'])
-
- todaySessionMenuLogic.actions.moveSession('task-1', 'space-b')
- await expectLogic(logic).toDispatchActions(['sessionUpdated', 'loadSessionsSuccess'])
-
- expect(logic.values.feedSections).toEqual([])
- })
-
it.each([
['a new name', ' checkout ', [{ name: 'checkout' }], 'checkout', null, null],
['a blank name', ' ', [], 'space-a', ' ', 'Enter a name'],
diff --git a/products/tasks/frontend/spaces/useSpaceFeedBulkSelection.ts b/products/tasks/frontend/spaces/useSpaceFeedBulkSelection.ts
index 1de46fd52732..e5ad0a69657d 100644
--- a/products/tasks/frontend/spaces/useSpaceFeedBulkSelection.ts
+++ b/products/tasks/frontend/spaces/useSpaceFeedBulkSelection.ts
@@ -7,15 +7,13 @@ import { spaceFeedSelectionLogic } from './spaceFeedSelectionLogic'
export function useSpaceFeedBulkSelection(spaceId: string): TodayBulkSelection {
const logic = spaceFeedSelectionLogic({ id: spaceId })
const { selectedSessionIds, bulkPinDirection, bulkAction, runningSelectedCount } = useValues(logic)
- const { pinSelected, fileSelectedTo, requestBulkArchive } = useActions(logic)
+ const { pinSelected, requestBulkArchive } = useActions(logic)
return {
- spaceId,
selectedSessionIds,
bulkPinDirection,
bulkAction,
runningSelectedCount,
pinSelected,
- fileSelectedTo,
requestBulkArchive,
}
}