@sensiblestats/widget-react 0.39.0 → 0.40.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # @sensiblestats/widget-react
2
2
 
3
+ ## 0.40.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Greeting dashboard tiles can now carry an opaque `actionRef`: when the server binds a tile to a tool, a tap forwards the ref (resolved server-side, skipping the LLM planning turn) and `actionValue` stays as the fallback. Adds `actionRef` to `GreetingDashboardTile`; `MessageList` forwards it on tap when present.
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies
12
+ - @sensiblestats/widget-sdk@0.30.1
13
+
14
+ ## 0.39.1
15
+
16
+ ### Patch Changes
17
+
18
+ - 428171d: Fix dead scroll space below the chat: the top-anchor spacer was reserved even when a turn was first shown already-complete (panel opened after the greeting finished, or a restored/cross-tab-synced conversation), leaving a full viewport of blank scrollable space. It is now reserved only while a turn is actively streaming. Also adds `overscroll-behavior: contain` to the message list and drops the `+` icon from the "New conversation" menu item.
19
+
3
20
  ## 0.39.0
4
21
 
5
22
  ### Minor Changes
package/dist/index.cjs CHANGED
@@ -1431,9 +1431,6 @@ function CloseIcon() {
1431
1431
  function ChevronIcon() {
1432
1432
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", { viewBox: "0 0 24 24", width: "1em", height: "1em", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) });
1433
1433
  }
1434
- function NewChatIcon() {
1435
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", { viewBox: "0 0 24 24", width: "1em", height: "1em", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { fill: "none", d: "M12 5v14M5 12h14", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" }) });
1436
- }
1437
1434
  function KebabIcon() {
1438
1435
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", { viewBox: "0 0 24 24", width: "1em", height: "1em", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("g", { fill: "currentColor", children: [
1439
1436
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("circle", { cx: "12", cy: "5", r: "1.6" }),
@@ -1567,7 +1564,7 @@ function ChatHeader({
1567
1564
  children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(KebabIcon, {})
1568
1565
  }
1569
1566
  ),
1570
- menuOpen ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "ss-w-menu", role: "menu", "aria-label": moreOptionsLabel, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
1567
+ menuOpen ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "ss-w-menu", role: "menu", "aria-label": moreOptionsLabel, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1571
1568
  "button",
1572
1569
  {
1573
1570
  type: "button",
@@ -1575,10 +1572,7 @@ function ChatHeader({
1575
1572
  role: "menuitem",
1576
1573
  ref: firstItemRef,
1577
1574
  onClick: runNewConversation,
1578
- children: [
1579
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(NewChatIcon, {}),
1580
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { children: newConversationLabel })
1581
- ]
1575
+ children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { children: newConversationLabel })
1582
1576
  }
1583
1577
  ) }) : null
1584
1578
  ] }) : null,
@@ -3080,7 +3074,7 @@ function MessageList({ controller, ui, slip, onDashboardTap, monitor }) {
3080
3074
  const list = listRef.current;
3081
3075
  if (anchor && anchor.turnId !== anchoredTurnRef.current) {
3082
3076
  anchoredTurnRef.current = anchor.turnId;
3083
- if (endRef.current && list) endRef.current.style.height = `${list.clientHeight}px`;
3077
+ if (endRef.current && list) endRef.current.style.height = state.isStreaming ? `${list.clientHeight}px` : "";
3084
3078
  pinnedRef.current = false;
3085
3079
  list?.querySelector(`[data-msg-id="${anchor.anchorId}"]`)?.scrollIntoView({ block: "start" });
3086
3080
  return;
@@ -3107,7 +3101,7 @@ function MessageList({ controller, ui, slip, onDashboardTap, monitor }) {
3107
3101
  disabled: state.isStreaming,
3108
3102
  onAct: (a) => send(a.message, { actionId: a.actionId, actionRef: a.actionRef, displayText: a.label }),
3109
3103
  onTap: (tile, index) => {
3110
- send(tile.actionValue, { displayText: tile.title });
3104
+ send(tile.actionValue, tile.actionRef ? { actionRef: tile.actionRef, displayText: tile.title } : { displayText: tile.title });
3111
3105
  if (m.role === "assistant" && m.greetingDashboard) onDashboardTap?.(tile, index, m.greetingDashboard.layout);
3112
3106
  },
3113
3107
  ui,
@@ -3610,7 +3604,7 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
3610
3604
  /* .ss-w-mon-list (Matches/Odds tab scrollers) shares .ss-w-list's box/scroll rules by design --
3611
3605
  same visual rhythm as the chat message list -- but gets its own class so it isn't the same DOM
3612
3606
  landmark as the chat list when both exist in the panel at once (Task 16 fix round, M4). */
3613
- .ss-w-list, .ss-w-mon-list { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 12px; scroll-padding-top: 14px; }
3607
+ .ss-w-list, .ss-w-mon-list { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 14px; display: flex; flex-direction: column; gap: 12px; scroll-padding-top: 14px; }
3614
3608
  /* Transient bottom spacer: reserves a viewport of room below a new turn so its
3615
3609
  top can be scrolled into view while the reply is still streaming in. Height is
3616
3610
  set imperatively and flex must not shrink it away. */