mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-21 21:14:17 +02:00
Widen picker, collapse long descriptions into accordion
This commit is contained in:
parent
2075141864
commit
3b5d2c3a6a
1 changed files with 14 additions and 2 deletions
|
|
@ -959,6 +959,8 @@ def _build_picker_html(tools: list[dict[str, Any]]) -> str:
|
|||
from prefab_ui.actions import Fetch, OpenLink, SetState, ShowToast
|
||||
from prefab_ui.app import PrefabApp
|
||||
from prefab_ui.components import (
|
||||
Accordion,
|
||||
AccordionItem,
|
||||
Button,
|
||||
Column,
|
||||
Heading,
|
||||
|
|
@ -991,7 +993,7 @@ def _build_picker_html(tools: list[dict[str, Any]]) -> str:
|
|||
def _tool_title(tool: dict[str, Any]) -> str:
|
||||
return tool.get("title") or tool["name"]
|
||||
|
||||
with Column(gap=6, css_class="p-8 max-w-lg mx-auto") as view:
|
||||
with Column(gap=6, css_class="p-8 max-w-2xl mx-auto") as view:
|
||||
Heading("FastMCP Apps")
|
||||
|
||||
if len(tools) > 1:
|
||||
|
|
@ -1030,7 +1032,17 @@ def _build_picker_html(tools: list[dict[str, Any]]) -> str:
|
|||
|
||||
with Page(name, value=name), Column(gap=4):
|
||||
if desc:
|
||||
Markdown(desc, css_class="pb-2 text-sm text-muted-foreground")
|
||||
# Show the first paragraph inline; collapse the
|
||||
# rest into an expandable accordion.
|
||||
parts = desc.split("\n\n", 1)
|
||||
md_css = "text-sm text-muted-foreground"
|
||||
Muted(parts[0])
|
||||
if len(parts) > 1:
|
||||
with (
|
||||
Accordion(collapsible=True, css_class=md_css),
|
||||
AccordionItem(title="Details"),
|
||||
):
|
||||
Markdown(parts[1])
|
||||
with Tabs(variant="line"):
|
||||
with (
|
||||
Tab("Form"),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue