Read a flow name, a port name and an honest docstring
Give the Home flow-activity name cell a `sm:min-w-32` floor beside its `max-w-0` cap, so an ordinary name reads in full where there is room while the phone keeps today's truncation. Name the bar widget's nested reading by its port rather than its qualified message. Correct `MarkdownWidget`'s docstring to the subset it actually renders. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SKL7sUgNWhukDEz95vSMQv
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { displayName, flowOf } from "@/components/Flow/deriveEdges"
|
||||
import { useLiveValue } from "@/components/Flow/liveStore"
|
||||
import { cn } from "@/lib/utils"
|
||||
import type { WidgetProps } from "./widgets"
|
||||
@@ -28,6 +29,9 @@ export function BarWidget({ widget }: WidgetProps) {
|
||||
const cfg = config(widget)
|
||||
const message = text(cfg.message)
|
||||
const nested = text(cfg.inner)
|
||||
// The panel already carries the widget's title, so the caption names the
|
||||
// reading by its port rather than repeating the flow it comes from.
|
||||
const innerName = nested ? displayName(flowOf(nested), nested) : ""
|
||||
const outer = useLiveValue(message || undefined)
|
||||
const inner = useLiveValue(nested || undefined)
|
||||
if (!message)
|
||||
@@ -56,7 +60,7 @@ export function BarWidget({ widget }: WidgetProps) {
|
||||
role="img"
|
||||
aria-label={
|
||||
nested
|
||||
? `${write(value)} of ${max}${unit}, ${write(innerValue)} of it from ${nested}`
|
||||
? `${write(value)} of ${max}${unit}, ${write(innerValue)} of it from ${innerName}`
|
||||
: `${write(value)} of ${max}${unit}`
|
||||
}
|
||||
>
|
||||
@@ -89,7 +93,7 @@ export function BarWidget({ widget }: WidgetProps) {
|
||||
</div>
|
||||
{innerValue === null ? null : (
|
||||
<p className="truncate text-xs text-muted-foreground">
|
||||
{nested} {write(innerValue)}
|
||||
{innerName} {write(innerValue)}
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
|
||||
@@ -382,7 +382,8 @@ function GaugeWidget({ widget }: WidgetProps) {
|
||||
}
|
||||
|
||||
/**
|
||||
* A very small markdown subset: headings, bold, code, links, list items.
|
||||
* A very small markdown subset, read a line at a time: headings and list items.
|
||||
* Inline spans — bold, code, links — are not parsed and read as written.
|
||||
*
|
||||
* Enough for the labels and notes a dashboard carries, and not worth a parser.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user