Skip to content

armgit / umami

Public Imported from GitHub
0

Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.

Polish board and dashboard design actions

Mike Caod9766e3952c8
diff --git a/src/app/(main)/boards/BoardsTable.tsx b/src/app/(main)/boards/BoardsTable.tsx
index e1db5ff1f..25a10cdee 100644
--- a/src/app/(main)/boards/BoardsTable.tsx
+++ b/src/app/(main)/boards/BoardsTable.tsx
@@ -25,8 +25,8 @@ export function BoardsTable(props: DataTableProps) {
{({ id, name }: any) => {
return (
<Row>
- <BoardEditButton boardId={id} />
<BoardDesignButton boardId={id} />
+ <BoardEditButton boardId={id} />
<BoardDeleteButton boardId={id} name={name} />
</Row>
);
diff --git a/src/app/(main)/boards/[boardId]/BoardComponentSelect.tsx b/src/app/(main)/boards/[boardId]/BoardComponentSelect.tsx
index 67d0227b6..16c77d269 100644
--- a/src/app/(main)/boards/[boardId]/BoardComponentSelect.tsx
+++ b/src/app/(main)/boards/[boardId]/BoardComponentSelect.tsx
@@ -9,7 +9,6 @@ import {
TextField,
} from '@umami/react-zen';
import { useEffect, useMemo, useState } from 'react';
-import { Panel } from '@/components/common/Panel';
import { useMessages } from '@/components/hooks';
import { LinkSelect } from '@/components/input/LinkSelect';
import { PixelSelect } from '@/components/input/PixelSelect';
@@ -199,8 +198,8 @@ export function BoardComponentSelect({
return (
<Column gap="4">
- <Row gap="4" style={{ height: 600 }}>
- <Column gap="3" style={{ width: 320, flexShrink: 0, overflowY: 'auto' }}>
+ <Row gap="6" style={{ height: 600 }}>
+ <Column gap="3" style={{ width: 280, flexShrink: 0, overflowY: 'auto' }}>
<Text weight="bold">{t(labels.properties)}</Text>
{needsWebsite && isOpenType && (
@@ -313,10 +312,11 @@ export function BoardComponentSelect({
)}
</Column>
- <Column gap="3" style={{ width: 280, flexShrink: 0, minWidth: 0 }}>
- <Panel maxHeight="100%">
+ <Column gap="3" height="100%" style={{ width: 280, flexShrink: 0, minWidth: 0 }}>
+ <Text weight="bold">Components</Text>
+ <Column border="left" paddingLeft="4" height="100%" style={{ minHeight: 0 }}>
{hasSelectedEntity ? (
- <Column gap="1" height="100%" style={{ overflowY: 'auto' }}>
+ <Column gap="1" height="100%" style={{ overflowY: 'auto', minHeight: 0 }}>
{availableDefinitions.map(def => {
const Icon = def.icon;
@@ -324,7 +324,7 @@ export function BoardComponentSelect({
<Focusable key={def.type}>
<Row
gap="3"
- alignItems="center"
+ alignItems="flex-start"
paddingX="3"
paddingY="2"
borderRadius
@@ -357,11 +357,12 @@ export function BoardComponentSelect({
<Text color="muted">{t(messages.selectBoardEntityFirst)}</Text>
</Column>
)}
- </Panel>
+ </Column>
</Column>
- <Column gap="3" flexGrow={1} style={{ minWidth: 0 }}>
- <Panel maxHeight="100%">
+ <Column gap="3" flexGrow={1} height="100%" style={{ minWidth: 0 }}>
+ <Text weight="bold">Preview</Text>
+ <Column border="left" paddingLeft="4" height="100%" style={{ minWidth: 0 }}>
{hasSelectedEntity && previewConfig && (!needsWebsite || resolvedEntityId) ? (
<BoardComponentRenderer config={previewConfig} websiteId={resolvedEntityId} />
) : (
@@ -375,7 +376,7 @@ export function BoardComponentSelect({
</Text>
</Column>
)}
- </Panel>
+ </Column>
</Column>
</Row>
diff --git a/src/app/(main)/boards/[boardId]/BoardEditColumn.tsx b/src/app/(main)/boards/[boardId]/BoardEditColumn.tsx
index 4ea0656b3..e0d3395da 100644
--- a/src/app/(main)/boards/[boardId]/BoardEditColumn.tsx
+++ b/src/app/(main)/boards/[boardId]/BoardEditColumn.tsx
@@ -80,7 +80,13 @@ export function BoardEditColumn({
onMouseLeave={() => setShowActions(false)}
>
{canEdit && canRemoveAction && showActions && (
- <Box position="absolute" top="12px" right="12px" zIndex={100}>
+ <Box
+ position="absolute"
+ top="50%"
+ left="50%"
+ zIndex={100}
+ style={{ transform: 'translate(-50%, -50%)' }}
+ >
<Row gap="1" padding="2" borderRadius backgroundColor="surface-sunken">
{hasComponent && (
<TooltipTrigger delay={0}>
diff --git a/src/app/(main)/boards/[boardId]/BoardViewHeader.tsx b/src/app/(main)/boards/[boardId]/BoardViewHeader.tsx
index d20a67d95..8533e4534 100644
--- a/src/app/(main)/boards/[boardId]/BoardViewHeader.tsx
+++ b/src/app/(main)/boards/[boardId]/BoardViewHeader.tsx
@@ -27,12 +27,12 @@ export function BoardViewHeader({
{showEntityBadge && entityBadge && <BoardEntityBadge {...entityBadge} />}
{showActions && board?.id && (
<>
- <LinkButton href={renderUrl(`/boards/${board.id}/edit`, false)}>
- <IconLabel icon={<Edit />}>{t(labels.edit)}</IconLabel>
- </LinkButton>
<LinkButton href={renderUrl(`/boards/${board.id}/design`, false)}>
<IconLabel icon={<LayoutDashboard />}>Design</IconLabel>
</LinkButton>
+ <LinkButton href={renderUrl(`/boards/${board.id}/edit`, false)}>
+ <IconLabel icon={<Edit />}>{t(labels.edit)}</IconLabel>
+ </LinkButton>
</>
)}
</Row>
diff --git a/src/app/(main)/boards/[boardId]/edit/BoardEditPage.tsx b/src/app/(main)/boards/[boardId]/edit/BoardEditPage.tsx
index ff46863fc..4867cc5a8 100644
--- a/src/app/(main)/boards/[boardId]/edit/BoardEditPage.tsx
+++ b/src/app/(main)/boards/[boardId]/edit/BoardEditPage.tsx
@@ -26,7 +26,7 @@ export function BoardEditPage({ boardId }: { boardId: string }) {
<>
<Column marginTop="6">
<Link href={renderUrl(`/boards/${boardId}`)}>
- <IconLabel icon={<ArrowLeft />} label={t(labels.boards)} />
+ <IconLabel icon={<ArrowLeft />} label="Board" />
</Link>
</Column>
<PageHeader
diff --git a/src/app/(main)/boards/boardComponentRegistry.tsx b/src/app/(main)/boards/boardComponentRegistry.tsx
index 9bb39d71f..31d2f2c81 100644
--- a/src/app/(main)/boards/boardComponentRegistry.tsx
+++ b/src/app/(main)/boards/boardComponentRegistry.tsx
@@ -3,11 +3,12 @@ import { TextBlock } from '@/app/(main)/boards/TextBlock';
import { WebsiteChart } from '@/app/(main)/websites/[websiteId]/WebsiteChart';
import { WebsiteMetricsBar } from '@/app/(main)/websites/[websiteId]/WebsiteMetricsBar';
import {
- Activity,
Calendar,
+ ChartColumnBig,
ChartPie,
FileText,
Globe,
+ PanelTop,
Sheet,
} from '@/components/icons';
import { EventsChart } from '@/components/metrics/EventsChart';
@@ -75,7 +76,7 @@ const componentDefinitions: ComponentDefinition[] = [
name: 'Metrics bar',
description: 'Key metrics: views, visitors, bounces, time on site',
category: 'overview',
- icon: ChartPie,
+ icon: PanelTop,
component: WebsiteMetricsBar,
},
{
@@ -83,7 +84,7 @@ const componentDefinitions: ComponentDefinition[] = [
name: 'Website chart',
description: 'Page views and visitors over time',
category: 'overview',
- icon: Activity,
+ icon: ChartColumnBig,
component: WebsiteChart,
},
diff --git a/src/app/(main)/dashboard/DashboardViewHeader.tsx b/src/app/(main)/dashboard/DashboardViewHeader.tsx
index 6385e80ba..e4328fce8 100644
--- a/src/app/(main)/dashboard/DashboardViewHeader.tsx
+++ b/src/app/(main)/dashboard/DashboardViewHeader.tsx
@@ -2,7 +2,7 @@ import { IconLabel } from '@/components/common/IconLabel';
import { LinkButton } from '@/components/common/LinkButton';
import { PageHeader } from '@/components/common/PageHeader';
import { useMessages, useNavigation } from '@/components/hooks';
-import { Edit } from '@/components/icons';
+import { LayoutDashboard } from '@/components/icons';
export function DashboardViewHeader() {
const { t, labels } = useMessages();
@@ -11,7 +11,7 @@ export function DashboardViewHeader() {
return (
<PageHeader title={t(labels.dashboard)}>
<LinkButton href={renderUrl('/dashboard/edit', false)}>
- <IconLabel icon={<Edit />}>{t(labels.edit)}</IconLabel>
+ <IconLabel icon={<LayoutDashboard />}>Design</IconLabel>
</LinkButton>
</PageHeader>
);