: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.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
fix(today): match the desktop header and insets in space settings (#109820)
Shy Alter73f1b5a9a7c0
diff --git a/products/tasks/frontend/spaces/SpaceSettings.tsx b/products/tasks/frontend/spaces/SpaceSettings.tsxindex 8fd91ee3c144..7cda98700493 100644--- a/products/tasks/frontend/spaces/SpaceSettings.tsx+++ b/products/tasks/frontend/spaces/SpaceSettings.tsx@@ -83,222 +83,231 @@ export function SpaceSettings({ id }: { id: string }): JSX.Element {if (!space) {return (- <div className="flex w-full max-w-200 flex-col gap-7 pt-4 pb-8" aria-busy="true">- <Skeleton className="mx-0.5 h-4 w-80 max-w-full" />- {[1, 2, 3].map((section) => (- <div key={section} className="flex flex-col gap-2">- <Skeleton className="h-4 w-28" />- <Skeleton className="h-14 w-full" />- </div>- ))}+ <div className="-mx-4" aria-busy="true">+ <div className="flex min-h-11 items-center border-b border-border px-6 py-2">+ <Skeleton className="h-4 w-80 max-w-full" />+ </div>+ <div className="flex w-full max-w-200 flex-col gap-7 px-6 pt-6 pb-8">+ {[1, 2, 3].map((section) => (+ <div key={section} className="flex flex-col gap-2">+ <Skeleton className="h-4 w-28" />+ <Skeleton className="h-14 w-full" />+ </div>+ ))}+ </div></div>)}return (- <div className="flex w-full max-w-200 flex-col gap-7 pt-4 pb-8">- <Text size="xs" variant="muted" className="px-0.5">- The name, repositories, and who can see this space. Changes save as you make them.- </Text>-- <SpaceSettingsSection label="General">- <ItemGroup combined>- <Item variant="outline" size="sm">- <ItemContent className={ROW_CONTENT_CLASS}>- <ItemTitle id="space-settings-name-label">Name</ItemTitle>- <ItemDescription id="space-settings-name-description">- {renameDisabledReason ?? 'Shown in the sidebar and at the top of this space.'}- </ItemDescription>- </ItemContent>- <Field className="w-64 max-w-full" data-invalid={!!nameError || undefined}>- <Input- value={renameDisabledReason ? spaceLabel(space) : (nameDraft ?? space.name)}- onChange={(event: ChangeEvent<HTMLInputElement>) => setNameDraft(event.target.value)}- onBlur={() => commitName()}- onKeyDown={(event: KeyboardEvent<HTMLInputElement>) => {- if (event.key === 'Enter') {- commitName()- } else if (event.key === 'Escape') {- setNameDraft(null)+ <div className="-mx-4">+ <div className="flex min-h-11 items-center border-b border-border px-6 py-2">+ <Text size="xs" variant="muted" className="min-w-0">+ The name, repositories, and who can see this space. Changes save as you make them.+ </Text>+ </div>+ <div className="flex w-full max-w-200 flex-col gap-7 px-6 pt-6 pb-8">+ <SpaceSettingsSection label="General">+ <ItemGroup combined>+ <Item variant="outline" size="sm">+ <ItemContent className={ROW_CONTENT_CLASS}>+ <ItemTitle id="space-settings-name-label">Name</ItemTitle>+ <ItemDescription id="space-settings-name-description">+ {renameDisabledReason ?? 'Shown in the sidebar and at the top of this space.'}+ </ItemDescription>+ </ItemContent>+ <Field className="w-64 max-w-full" data-invalid={!!nameError || undefined}>+ <Input+ value={renameDisabledReason ? spaceLabel(space) : (nameDraft ?? space.name)}+ onChange={(event: ChangeEvent<HTMLInputElement>) =>+ setNameDraft(event.target.value)}- }}- disabled={!!renameDisabledReason}- aria-labelledby="space-settings-name-label"- aria-describedby="space-settings-name-description"- aria-invalid={!!nameError || undefined}- data-attr="today-space-settings-name"- />- {nameError && <FieldError>{nameError}</FieldError>}- </Field>- </Item>- </ItemGroup>- </SpaceSettingsSection>+ onBlur={() => commitName()}+ onKeyDown={(event: KeyboardEvent<HTMLInputElement>) => {+ if (event.key === 'Enter') {+ commitName()+ } else if (event.key === 'Escape') {+ setNameDraft(null)+ }+ }}+ disabled={!!renameDisabledReason}+ aria-labelledby="space-settings-name-label"+ aria-describedby="space-settings-name-description"+ aria-invalid={!!nameError || undefined}+ data-attr="today-space-settings-name"+ />+ {nameError && <FieldError>{nameError}</FieldError>}+ </Field>+ </Item>+ </ItemGroup>+ </SpaceSettingsSection>- <SpaceRepositories id={id} />- <SpaceAccess id={id} />- <SpaceMembers id={id} />+ <SpaceRepositories id={id} />+ <SpaceAccess id={id} />+ <SpaceMembers id={id} />- <SpaceSettingsSection label="Sessions">- <ItemGroup combined>- <Item variant="outline" size="sm">- <ItemContent className={ROW_CONTENT_CLASS}>- <ItemTitle id="space-auto-archive-label">Auto-archive</ItemTitle>- <ItemDescription>- Archive sessions after a period with no activity. New messages and runs start the period- again.- </ItemDescription>- </ItemContent>- <ItemActions>- <Tooltip disabled={!autoArchiveDisabledReason || savingSpace}>- <TooltipTrigger render={<div />}>- <Select<AutoArchiveSelection>- items={AUTO_ARCHIVE_OPTIONS}- value={autoArchiveSelection}- onValueChange={(selection: AutoArchiveSelection) =>- setAutoArchiveSelection(selection)- }- disabled={!!autoArchiveDisabledReason}- >- <SelectTrigger- aria-labelledby="space-auto-archive-label"- data-attr="today-space-settings-auto-archive"- >- <SelectValue />- </SelectTrigger>- <SelectContent>- {AUTO_ARCHIVE_OPTIONS.map((option) => (- <SelectItem key={option.label} value={option.value}>- {option.label}- </SelectItem>- ))}- </SelectContent>- </Select>- </TooltipTrigger>- <TooltipContent>{autoArchiveDisabledReason}</TooltipContent>- </Tooltip>- </ItemActions>- </Item>- {autoArchiveSelection === 'custom' && (+ <SpaceSettingsSection label="Sessions">+ <ItemGroup combined><Item variant="outline" size="sm"><ItemContent className={ROW_CONTENT_CLASS}>- <ItemTitle id="space-auto-archive-custom-days-label">Days of inactivity</ItemTitle>- {autoArchiveCustomError ? (- <FieldError>{autoArchiveCustomError}</FieldError>- ) : (- <ItemDescription>- Choose a value from {AUTO_ARCHIVE_MIN_DAYS} to {AUTO_ARCHIVE_MAX_DAYS} days.- </ItemDescription>- )}+ <ItemTitle id="space-auto-archive-label">Auto-archive</ItemTitle>+ <ItemDescription>+ Archive sessions after a period with no activity. New messages and runs start the+ period again.+ </ItemDescription></ItemContent>- <Field- orientation="horizontal"- className="w-auto"- data-invalid={!!autoArchiveCustomError || undefined}- >- <NumberFieldRoot- className="w-24"- value={autoArchiveCustomDays}- onValueChange={(days: number | null) => setAutoArchiveCustomDays(days)}- min={AUTO_ARCHIVE_MIN_DAYS}- max={AUTO_ARCHIVE_MAX_DAYS}- step={1}- allowOutOfRange- disabled={!!autoArchiveDisabledReason}- >- <NumberFieldGroup>- <NumberFieldInput- aria-labelledby="space-auto-archive-custom-days-label"- aria-invalid={!!autoArchiveCustomError || undefined}- data-attr="today-space-settings-auto-archive-custom-days"- />- </NumberFieldGroup>- </NumberFieldRoot>- <Tooltip disabled={!autoArchiveCustomSaveDisabledReason || savingSpace}>- <TooltipTrigger- render={- <Button- variant="outline"- loading={savingSpace}- disabled={!!autoArchiveCustomSaveDisabledReason}- onClick={() => saveAutoArchiveCustomDays()}- data-attr="today-space-settings-auto-archive-custom-save"- />- }- >- Save+ <ItemActions>+ <Tooltip disabled={!autoArchiveDisabledReason || savingSpace}>+ <TooltipTrigger render={<div />}>+ <Select<AutoArchiveSelection>+ items={AUTO_ARCHIVE_OPTIONS}+ value={autoArchiveSelection}+ onValueChange={(selection: AutoArchiveSelection) =>+ setAutoArchiveSelection(selection)+ }+ disabled={!!autoArchiveDisabledReason}+ >+ <SelectTrigger+ aria-labelledby="space-auto-archive-label"+ data-attr="today-space-settings-auto-archive"+ >+ <SelectValue />+ </SelectTrigger>+ <SelectContent>+ {AUTO_ARCHIVE_OPTIONS.map((option) => (+ <SelectItem key={option.label} value={option.value}>+ {option.label}+ </SelectItem>+ ))}+ </SelectContent>+ </Select></TooltipTrigger>- <TooltipContent>{autoArchiveCustomSaveDisabledReason}</TooltipContent>+ <TooltipContent>{autoArchiveDisabledReason}</TooltipContent></Tooltip>- </Field>+ </ItemActions></Item>- )}- </ItemGroup>- <Text size="xs" variant="muted" className="px-0.5">- Pinned and running sessions, and sessions someone is viewing, are never archived. In shared spaces,- only project admins can change this.- </Text>- </SpaceSettingsSection>-- <SpaceSettingsSection label="Danger zone">- <ItemGroup combined>- <Item variant="outline" size="sm">- <ItemContent className={ROW_CONTENT_CLASS}>- <ItemTitle>Delete space</ItemTitle>- <ItemDescription>- This removes the space for everyone. It only works when the space has no sessions or- canvases.- </ItemDescription>- </ItemContent>- <ItemActions>- <AlertDialog>- <Tooltip disabled={!deleteDisabledReason}>- <TooltipTrigger- render={- <AlertDialogTrigger- render={- <Button- variant="destructive"- disabled={!!deleteDisabledReason}- data-attr="today-space-settings-delete"- />- }- />- }+ {autoArchiveSelection === 'custom' && (+ <Item variant="outline" size="sm">+ <ItemContent className={ROW_CONTENT_CLASS}>+ <ItemTitle id="space-auto-archive-custom-days-label">Days of inactivity</ItemTitle>+ {autoArchiveCustomError ? (+ <FieldError>{autoArchiveCustomError}</FieldError>+ ) : (+ <ItemDescription>+ Choose a value from {AUTO_ARCHIVE_MIN_DAYS} to {AUTO_ARCHIVE_MAX_DAYS} days.+ </ItemDescription>+ )}+ </ItemContent>+ <Field+ orientation="horizontal"+ className="w-auto"+ data-invalid={!!autoArchiveCustomError || undefined}+ >+ <NumberFieldRoot+ className="w-24"+ value={autoArchiveCustomDays}+ onValueChange={(days: number | null) => setAutoArchiveCustomDays(days)}+ min={AUTO_ARCHIVE_MIN_DAYS}+ max={AUTO_ARCHIVE_MAX_DAYS}+ step={1}+ allowOutOfRange+ disabled={!!autoArchiveDisabledReason}>- Delete space- </TooltipTrigger>- <TooltipContent>{deleteDisabledReason}</TooltipContent>- </Tooltip>- <AlertDialogContent>- <AlertDialogHeader>- <AlertDialogTitle>{`Delete ${spaceLabel(space)}?`}</AlertDialogTitle>- <AlertDialogDescription>- This removes the space for everyone. You can only delete a space that has no- sessions or canvases.- </AlertDialogDescription>- </AlertDialogHeader>- <AlertDialogFooter>- <AlertDialogClose render={<Button variant="outline" />}>- Cancel- </AlertDialogClose>- <AlertDialogClose+ <NumberFieldGroup>+ <NumberFieldInput+ aria-labelledby="space-auto-archive-custom-days-label"+ aria-invalid={!!autoArchiveCustomError || undefined}+ data-attr="today-space-settings-auto-archive-custom-days"+ />+ </NumberFieldGroup>+ </NumberFieldRoot>+ <Tooltip disabled={!autoArchiveCustomSaveDisabledReason || savingSpace}>+ <TooltipTriggerrender={<Button- variant="destructive-outline"- onClick={() => deleteSpace()}- data-attr="today-space-settings-delete-confirm"+ variant="outline"+ loading={savingSpace}+ disabled={!!autoArchiveCustomSaveDisabledReason}+ onClick={() => saveAutoArchiveCustomDays()}+ data-attr="today-space-settings-auto-archive-custom-save"/>}>- Delete- </AlertDialogClose>- </AlertDialogFooter>- </AlertDialogContent>- </AlertDialog>- </ItemActions>- </Item>- </ItemGroup>- </SpaceSettingsSection>+ Save+ </TooltipTrigger>+ <TooltipContent>{autoArchiveCustomSaveDisabledReason}</TooltipContent>+ </Tooltip>+ </Field>+ </Item>+ )}+ </ItemGroup>+ <Text size="xs" variant="muted" className="px-0.5">+ Pinned and running sessions, and sessions someone is viewing, are never archived. In shared+ spaces, only project admins can change this.+ </Text>+ </SpaceSettingsSection>++ <SpaceSettingsSection label="Danger zone">+ <ItemGroup combined>+ <Item variant="outline" size="sm">+ <ItemContent className={ROW_CONTENT_CLASS}>+ <ItemTitle>Delete space</ItemTitle>+ <ItemDescription>+ This removes the space for everyone. It only works when the space has no sessions or+ canvases.+ </ItemDescription>+ </ItemContent>+ <ItemActions>+ <AlertDialog>+ <Tooltip disabled={!deleteDisabledReason}>+ <TooltipTrigger+ render={+ <AlertDialogTrigger+ render={+ <Button+ variant="destructive"+ disabled={!!deleteDisabledReason}+ data-attr="today-space-settings-delete"+ />+ }+ />+ }+ >+ Delete space+ </TooltipTrigger>+ <TooltipContent>{deleteDisabledReason}</TooltipContent>+ </Tooltip>+ <AlertDialogContent>+ <AlertDialogHeader>+ <AlertDialogTitle>{`Delete ${spaceLabel(space)}?`}</AlertDialogTitle>+ <AlertDialogDescription>+ This removes the space for everyone. You can only delete a space that+ has no sessions or canvases.+ </AlertDialogDescription>+ </AlertDialogHeader>+ <AlertDialogFooter>+ <AlertDialogClose render={<Button variant="outline" />}>+ Cancel+ </AlertDialogClose>+ <AlertDialogClose+ render={+ <Button+ variant="destructive-outline"+ onClick={() => deleteSpace()}+ data-attr="today-space-settings-delete-confirm"+ />+ }+ >+ Delete+ </AlertDialogClose>+ </AlertDialogFooter>+ </AlertDialogContent>+ </AlertDialog>+ </ItemActions>+ </Item>+ </ItemGroup>+ </SpaceSettingsSection>+ </div></div>)}