Compare commits

...
Author SHA1 Message Date
Thomas b57e45637c Merge branch 'dev' into fix/bookmark-with-border-option 2026-06-03 10:03:54 +02:00
Thomas 3429b6ff2d Merge branch 'dev' into fix/bookmark-with-border-option 2026-06-03 08:45:52 +02:00
ajnart 144a55b34e style: auto-fix lint and format 2026-06-02 20:08:53 +00:00
Thomas Camlong 46ccc6c245 fix: add bookmark widget option to toggle card borders
Replace hardcoded borderless cards with a withBorder switch defaulting to false so existing bookmarks stay borderless while users can opt in to borders.
2026-06-02 22:07:40 +02:00
3 changed files with 21 additions and 2 deletions

No files matched your search

+3
View File
@@ -1405,6 +1405,9 @@
"openNewTab": { "openNewTab": {
"label": "Open in new tab" "label": "Open in new tab"
}, },
"withBorder": {
"label": "Show border"
},
"items": { "items": {
"label": "Bookmarks", "label": "Bookmarks",
"add": "Add bookmark" "add": "Add bookmark"
+17 -2
View File
@@ -16,7 +16,7 @@ export default function BookmarksWidget({ options, itemId }: WidgetComponentProp
const board = useRequiredBoard(); const board = useRequiredBoard();
const [data] = clientApi.app.byIds.useSuspenseQuery(options.items, { const [data] = clientApi.app.byIds.useSuspenseQuery(options.items, {
select(data) { select(data) {
return data.sort((appA, appB) => options.items.indexOf(appA.id) - options.items.indexOf(appB.id)); return data.toSorted((appA, appB) => options.items.indexOf(appA.id) - options.items.indexOf(appB.id));
}, },
}); });
@@ -56,6 +56,7 @@ export default function BookmarksWidget({ options, itemId }: WidgetComponentProp
hideIcon={options.hideIcon} hideIcon={options.hideIcon}
hideHostname={options.hideHostname} hideHostname={options.hideHostname}
openNewTab={options.openNewTab} openNewTab={options.openNewTab}
withBorder={options.withBorder}
hasIconColor={board.iconColor !== null} hasIconColor={board.iconColor !== null}
/> />
)} )}
@@ -67,6 +68,7 @@ export default function BookmarksWidget({ options, itemId }: WidgetComponentProp
hideIcon={options.hideIcon} hideIcon={options.hideIcon}
hideHostname={options.hideHostname} hideHostname={options.hideHostname}
openNewTab={options.openNewTab} openNewTab={options.openNewTab}
withBorder={options.withBorder}
hasIconColor={board.iconColor !== null} hasIconColor={board.iconColor !== null}
/> />
)} )}
@@ -81,6 +83,7 @@ interface FlexLayoutProps {
hideIcon: boolean; hideIcon: boolean;
hideHostname: boolean; hideHostname: boolean;
openNewTab: boolean; openNewTab: boolean;
withBorder: boolean;
hasIconColor: boolean; hasIconColor: boolean;
} }
@@ -91,6 +94,7 @@ const FlexLayout = ({
hideIcon, hideIcon,
hideHostname, hideHostname,
openNewTab, openNewTab,
withBorder,
hasIconColor, hasIconColor,
}: FlexLayoutProps) => { }: FlexLayoutProps) => {
const board = useRequiredBoard(); const board = useRequiredBoard();
@@ -106,7 +110,15 @@ const FlexLayout = ({
key={app.id} key={app.id}
w="100%" w="100%"
> >
<Card radius={board.itemRadius} className={classes.card} w="100%" display="flex" p={4} h="100%"> <Card
radius={board.itemRadius}
className={classes.card}
w="100%"
display="flex"
p={4}
h="100%"
withBorder={withBorder}
>
{direction === "row" ? ( {direction === "row" ? (
<VerticalItem <VerticalItem
app={app} app={app}
@@ -138,6 +150,7 @@ interface GridLayoutProps {
hideIcon: boolean; hideIcon: boolean;
hideHostname: boolean; hideHostname: boolean;
openNewTab: boolean; openNewTab: boolean;
withBorder: boolean;
itemDirection: "horizontal" | "vertical"; itemDirection: "horizontal" | "vertical";
hasIconColor: boolean; hasIconColor: boolean;
} }
@@ -148,6 +161,7 @@ const GridLayout = ({
hideIcon, hideIcon,
hideHostname, hideHostname,
openNewTab, openNewTab,
withBorder,
itemDirection, itemDirection,
hasIconColor, hasIconColor,
}: GridLayoutProps) => { }: GridLayoutProps) => {
@@ -168,6 +182,7 @@ const GridLayout = ({
h="100%" h="100%"
className={combineClasses(classes.card, classes["card-grid"])} className={combineClasses(classes.card, classes["card-grid"])}
radius={board.itemRadius} radius={board.itemRadius}
withBorder={withBorder}
p="xs" p="xs"
> >
{itemDirection === "horizontal" ? ( {itemDirection === "horizontal" ? (
+1
View File
@@ -24,6 +24,7 @@ export const { definition, componentLoader } = createWidgetDefinition("bookmarks
hideIcon: factory.switch({ defaultValue: false }), hideIcon: factory.switch({ defaultValue: false }),
hideHostname: factory.switch({ defaultValue: false }), hideHostname: factory.switch({ defaultValue: false }),
openNewTab: factory.switch({ defaultValue: true }), openNewTab: factory.switch({ defaultValue: true }),
withBorder: factory.switch({ defaultValue: false }),
items: factory.sortableItemList<RouterOutputs["app"]["all"][number], string>({ items: factory.sortableItemList<RouterOutputs["app"]["all"][number], string>({
ItemComponent: ({ item, handle: Handle, removeItem, rootAttributes }) => { ItemComponent: ({ item, handle: Handle, removeItem, rootAttributes }) => {
return ( return (