@g9tm/aiassistant-lynx 1.4.1 → 1.5.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/dist/pages.jsx CHANGED
@@ -146,12 +146,13 @@ function HistoryBody(props) {
146
146
  const change = (call) => { void call.then(load, () => load().then(() => setFailed(true))); };
147
147
  const tabs = historyTabs(rows ?? [], new Date(timer(ui.assistant.host).now()), search);
148
148
  const counts = tabCounts(tabs);
149
- const shown = tabs[tab];
149
+ const shown = new Map(Object.entries(tabs)).get(tab) ?? [];
150
+ const countOf = (k) => new Map(Object.entries(counts)).get(k) ?? 0;
150
151
  const open = async (id) => { await ui.assistant.open(id); props.onOpen?.(id); };
151
152
  return (<Frame failed={failed} flow={props.flow}>
152
153
  <input style={{ ...field(ui), marginBottom: "8px" }} placeholder={t("history.search")} accessibility-label={t("history.search")} bindinput={(e) => setSearch(e.detail.value)}/>
153
154
  <view className="g9a-history-tabs" style={{ ...rowOf(ui, "6px"), flexWrap: "wrap", marginBottom: "8px" }}>
154
- {HISTORY_TABS.map((k) => <Tab key={k} label={t("history." + k)} count={counts[k]} on={tab === k} onTap={() => setTab(k)}/>)}
155
+ {HISTORY_TABS.map((k) => <Tab key={k} label={t("history." + k)} count={countOf(k)} on={tab === k} onTap={() => setTab(k)}/>)}
155
156
  </view>
156
157
  {rows !== null && shown.length === 0 ? <Empty words={t("history.empty")}/> : shown.map((c) => (<HistoryRow key={c.id} row={c} onOpen={() => void open(c.id)} onPin={() => change(pageCalls.pin(api, c.id, !c.pinned))} onDelete={() => setDoomed(c)}/>))}
157
158
  <Dialog open={doomed !== null} label={t("history.delete_confirm")} onClose={() => setDoomed(null)}>
package/dist/parts.jsx CHANGED
@@ -4,7 +4,7 @@
4
4
  * every interactive element has an accessibility label; the growing message is drawn below the recycled list.
5
5
  */
6
6
  import { useEffect, useState } from "@lynx-js/react";
7
- import { arr, blockView, can, finished, needsCode, obj, parseText, str, visibleText, LONG_RUNNING_MS, REVEAL_MS, windowView } from "@g9tm/aiassistant";
7
+ import { arr, blockView, can, finished, needsCode, obj, parseText, str, visibleText, LONG_RUNNING_MS, REMOTE_EXPIRED, REVEAL_MS, windowView } from "@g9tm/aiassistant";
8
8
  import { pageTexts, saveCsv } from "@g9tm/aiassistant/pages";
9
9
  import { Chart } from "./chart.jsx";
10
10
  import { blockOverride, cls, fill, override, rowOf, swappable, tok, useUi } from "./context.jsx";
@@ -121,7 +121,7 @@ export function ApprovalCard(props) {
121
121
  const confirm = async () => {
122
122
  if (needsCode(p.method) && code.length === 0)
123
123
  return;
124
- await ui.assistant.confirm(p.id, needsCode(p.method) ? code : null);
124
+ await ui.assistant.confirm(p.id, needsCode(p.method) || (p.failCode === REMOTE_EXPIRED && code.length > 0) ? code : null); // after the phone ran out, a code may stand in
125
125
  setCode("");
126
126
  setEpoch((n) => n + 1);
127
127
  };
@@ -134,7 +134,7 @@ export function ApprovalCard(props) {
134
134
  {s.diff.map((d, i) => <text key={"d" + String(i)} className={cls(ui, "card.approval.fact")} style={{ fontSize: "12px" }}>{say(d.name, d.args) + ": " + (d.before ?? "—") + " ← " + (d.after ?? "—")}</text>)}
135
135
  </view>))}
136
136
  {p.answered === null ? (<view>
137
- {needsCode(p.method) ? <view className={cls(ui, "card.approval.code")}><PinPad key={epoch} label={t("card.code")} onInput={setCode}/></view> : null}
137
+ {needsCode(p.method) || p.failCode === REMOTE_EXPIRED ? <view className={cls(ui, "card.approval.code")}><PinPad key={epoch} label={t("card.code")} onInput={setCode}/></view> : null}
138
138
  {p.failCode === "confirm.waiting" ? <text>{t("card.waiting")}</text> : p.failCode ? <text>{pageTexts(ui.texts).t(p.failCode)}{p.triesLeft !== null ? " · " + t("card.tries_left", { count: p.triesLeft }) : ""}</text> : null}
139
139
  <view style={rowOf(ui)}>
140
140
  <Button part="card.approval.confirm" primary label={t("card.confirm")} onTap={() => void confirm()}/>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@g9tm/aiassistant-lynx",
3
- "version": "1.4.1",
3
+ "version": "1.5.0",
4
4
  "description": "ReactLynx components for the G9 AI assistant, fully customisable (layouts, tokens, per-part classes, overrides, parts).",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -29,7 +29,7 @@
29
29
  "access": "public"
30
30
  },
31
31
  "dependencies": {
32
- "@g9tm/aiassistant": "1.4.1"
32
+ "@g9tm/aiassistant": "1.5.0"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@lynx-js/react": "0.129.2",