merge: sync release/v2 into assistant authoring
Preserve release/v2's concise public documentation while compacting the expanded skill trigger and routing text so the serialized lazy resource remains below 12,000 bytes.
This commit is contained in:
commit
288bbcff98
60 files changed
+3482
-4485
No files matched your search
@@ -136,12 +136,12 @@ Credentials are stored separately and never exported or returned to an agent. A
|
||||
|
||||
export const CUSTOM_WIDGET_SKILL_MD = `---
|
||||
name: homarr-custom-widget
|
||||
description: Author safe Homarr Custom JSX v2 widgets from API documentation.
|
||||
description: Author, validate, preview, test, install, or configure API-backed Homarr Custom JSX v2 widgets.
|
||||
---
|
||||
|
||||
# Homarr Custom Widget
|
||||
|
||||
Author one widget or a coordinated set of widgets. Start with the compact release-matched entrypoint; load only needed references, components, shared props, or examples. Run lifecycle tools alone; independent context reads may run together. For a set, research once and finish each widget's validation, evidence, and persistence before the next.
|
||||
Author one widget or a coordinated set of widgets. Load only needed release-matched context. Run lifecycle tools alone; independent reads may run together. For a set, research once and finish each widget's validation, evidence, and persistence before the next.
|
||||
|
||||
1. Read primary API documentation. Use web search when documentation is not supplied or may have changed.
|
||||
2. Create credential-free definitions with keyed \`sources\`, \`requests\`, optional \`options\`, and safe JSX \`template\`.
|
||||
|
||||
@@ -2272,6 +2272,9 @@
|
||||
"withBorder": {
|
||||
"label": "Show border"
|
||||
},
|
||||
"grow": {
|
||||
"label": "Expand cards to fill row"
|
||||
},
|
||||
"customUrls": {
|
||||
"label": "Custom links"
|
||||
},
|
||||
|
||||
@@ -6,6 +6,7 @@ import {
|
||||
Box,
|
||||
Card,
|
||||
Center,
|
||||
Grid,
|
||||
Group,
|
||||
ScrollArea,
|
||||
SimpleGrid,
|
||||
@@ -156,6 +157,14 @@ export default function BookmarksWidget({
|
||||
<Group gap={options.spacing} wrap="nowrap" mih="100%" align="stretch">
|
||||
{cards}
|
||||
</Group>
|
||||
) : options.grow ? (
|
||||
<Grid grow columns={plan.columns} gap={options.spacing}>
|
||||
{cards.map((card) => (
|
||||
<Grid.Col key={card.key} span={1}>
|
||||
{card}
|
||||
</Grid.Col>
|
||||
))}
|
||||
</Grid>
|
||||
) : (
|
||||
<SimpleGrid cols={plan.columns} spacing={options.spacing} verticalSpacing={options.spacing}>
|
||||
{cards}
|
||||
|
||||
@@ -49,6 +49,7 @@ export const { definition, componentLoader } = createWidgetDefinition("bookmarks
|
||||
hideHostname: factory.switch({ defaultValue: false }),
|
||||
openNewTab: factory.switch({ defaultValue: true }),
|
||||
withBorder: factory.switch({ defaultValue: false }),
|
||||
grow: factory.switch({ defaultValue: false }),
|
||||
customUrls: factory.internal({ defaultValue: [] as string[] }),
|
||||
items: factory.sortableItemList<BookmarkSelectionItem, string>({
|
||||
ItemComponent: ({ item, handle, removeItem, removeLabel, rootAttributes }) => {
|
||||
|
||||
@@ -240,8 +240,20 @@ export const getBookmarkDisplayPlan = ({
|
||||
};
|
||||
}
|
||||
|
||||
let columns: number = widthSettings.compactColumns;
|
||||
let orientation: BookmarkOrientation = "horizontal";
|
||||
if (layout === "gridHorizontal") {
|
||||
return {
|
||||
columns: Math.min(count, widthSettings.compactColumns),
|
||||
horizontalScroll: false,
|
||||
itemHeight: 56,
|
||||
itemWidth: widthSettings.rowItemWidth,
|
||||
orientation: "horizontal",
|
||||
showHostname: widthSettings.showHostname && heightSettings.showHostname,
|
||||
showTitle: widthSettings.showTitle && heightSettings.showTitle,
|
||||
};
|
||||
}
|
||||
|
||||
let columns: number = widthSettings.adaptiveColumns;
|
||||
let orientation: BookmarkOrientation = widthSettings.adaptiveOrientation;
|
||||
if (layout === "grid") {
|
||||
columns = widthSettings.gridColumns;
|
||||
orientation = "vertical";
|
||||
|
||||
Reference in new issue
Block a user