bb-plugin-manifest 0.17.0 → 0.17.1

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.
@@ -3,7 +3,7 @@
3
3
  "sdkVersion": "0.6.49",
4
4
  "artifactFormatVersion": 1,
5
5
  "pluginId": "manifest",
6
- "pluginVersion": "0.17.0",
6
+ "pluginVersion": "0.17.1",
7
7
  "builtWith": {
8
8
  "bbVersion": "0.46.1",
9
9
  "pluginSdkVersion": "0.6.49"
@@ -3,7 +3,7 @@
3
3
  "sdkVersion": "0.6.49",
4
4
  "artifactFormatVersion": 1,
5
5
  "pluginId": "manifest",
6
- "pluginVersion": "0.17.0",
6
+ "pluginVersion": "0.17.1",
7
7
  "builtWith": {
8
8
  "bbVersion": "0.46.1",
9
9
  "pluginSdkVersion": "0.6.49"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bb-plugin-manifest",
3
- "version": "0.17.0",
3
+ "version": "0.17.1",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist/",
@@ -12,7 +12,7 @@ import { errorText, useStatus, useTool } from "../hooks";
12
12
  import { Note } from "../RegistryList";
13
13
  import { Badge, ConfirmCard, KindLabel } from "../manifest";
14
14
  import type { ImportPreview, Need } from "../types";
15
- import { useOpenObject, useRailReturn } from "../workspace/state";
15
+ import { useOpenObject } from "../workspace/state";
16
16
  import { SectionTabs } from "../workspace/nav";
17
17
  import { NEEDS_HUB, OPEN_SOURCE, takeSource } from "./paths";
18
18
  import { Countries } from "./Countries";
@@ -36,16 +36,22 @@ function byCategory(items: Need[]): { category: string; items: Need[]; qty: numb
36
36
  /** The «Закупочный лист» rail: the last sheet chat or a new one, the sheet on the right. */
37
37
  export function NeedsPage(_: PluginNavPanelProps) {
38
38
  const openObject = useOpenObject();
39
- const railReturn = useRailReturn();
40
- const [stay, setStay] = useState(false);
39
+ const [error, setError] = useState<string | null>(null);
40
+ const [attempt, setAttempt] = useState(0);
41
41
  useEffect(() => {
42
- void railReturn("needs").then((r) => {
43
- if (r === "stay") setStay(true);
44
- else if (r === "none") void openObject(NEEDS_HUB);
45
- });
46
- }, [openObject, railReturn]);
47
- if (!stay) return <Note>Открываем закупочный лист…</Note>;
48
- return <NeedSheet />;
42
+ // Resolve the sheet's live chats and restore its focus, even if that chat now shows
43
+ // another object. The shared rail timer must never replace this entry with a page
44
+ // without a chat (including a quick switch from mail or a repeated rail click).
45
+ setError(null);
46
+ void openObject(NEEDS_HUB).catch((e: unknown) => setError(errorText(e)));
47
+ }, [attempt, openObject]);
48
+ if (!error) return <Note>Открываем закупочный лист…</Note>;
49
+ return (
50
+ <div className="p-3">
51
+ <p role="alert" className="text-xs text-destructive">{error}</p>
52
+ <Button size="sm" variant="outline" className="mt-2" onClick={() => setAttempt((n) => n + 1)}>Повторить открытие</Button>
53
+ </div>
54
+ );
49
55
  }
50
56
 
51
57