@dimina-kit/inspect 0.4.0-dev.20260716153350 → 0.4.0-dev.20260716163758

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.
@@ -59,6 +59,6 @@ export function AppDataPanel({ state, onSelectBridge, isRuntimeRunning = true, }
59
59
  const isActive = b.id === activeBridgeId;
60
60
  const bridgeEntries = entries[b.id] ?? {};
61
61
  const keys = Object.keys(bridgeEntries);
62
- return (_jsx("div", { "data-bridge-id": b.id, className: "absolute inset-0 flex flex-col gap-2 p-2 overflow-y-auto", style: { display: isActive ? 'flex' : 'none' }, children: keys.length === 0 ? (_jsx("div", { className: "text-[12px] text-text-dim text-center px-4 py-6", children: "\u6682\u65E0\u9875\u9762\u6570\u636E\uFF08\u4EC5\u663E\u793A Page \u7EA7 data\uFF09" })) : (keys.map((comp) => (_jsxs("div", { className: "border border-border-subtle rounded overflow-hidden shrink-0", children: [_jsx("div", { className: "bg-surface-3 px-2 py-0.5 text-[11px] text-code-label truncate", children: comp }), _jsx(JsonView, { value: (bridgeEntries[comp] ?? {}), collapsed: 1, displayDataTypes: false, displayObjectSize: false, enableClipboard: false, indentWidth: 12, style: JSON_VIEW_STYLE })] }, `${b.id}::${comp}`)))) }, b.id));
62
+ return (_jsx("div", { "data-bridge-id": b.id, className: "absolute inset-0 flex flex-col gap-2 p-2 overflow-y-auto", style: { display: isActive ? 'flex' : 'none' }, children: keys.length === 0 ? (_jsx("div", { className: "text-[12px] text-text-dim text-center px-4 py-6", children: isRuntimeRunning ? '暂无页面数据(仅显示 Page data)' : '小程序未运行' })) : (keys.map((comp) => (_jsxs("div", { className: "border border-border-subtle rounded overflow-hidden shrink-0", children: [_jsx("div", { className: "bg-surface-3 px-2 py-0.5 text-[11px] text-code-label truncate", children: comp }), _jsx(JsonView, { value: (bridgeEntries[comp] ?? {}), collapsed: 1, displayDataTypes: false, displayObjectSize: false, enableClipboard: false, indentWidth: 12, style: JSON_VIEW_STYLE })] }, `${b.id}::${comp}`)))) }, b.id));
63
63
  }) }))] }));
64
64
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dimina-kit/inspect",
3
- "version": "0.4.0-dev.20260716153350",
3
+ "version": "0.4.0-dev.20260716163758",
4
4
  "description": "Host-agnostic WXML tree extraction and inspection for dimina render layers: Vue runtime walk, stable-id registry, mutation-observing inspector, and a React tree panel.",
5
5
  "keywords": [
6
6
  "dimina",
@@ -34,6 +34,25 @@ describe('AppDataPanel: empty-state copy reflects whether the session is actuall
34
34
  ).toBe(true)
35
35
  })
36
36
 
37
+ it('keeps the "not running" copy inside a kept-alive bridge container whose entries are empty', () => {
38
+ // A host-built snapshot can carry a bridge with zero entries; the
39
+ // per-bridge empty text must not claim "no page data yet" while the
40
+ // session is actually down.
41
+ const state: AppDataState = {
42
+ bridges: [{ id: 'b1', pagePath: 'pages/index/index' }],
43
+ activeBridgeId: 'b1',
44
+ entries: { b1: {} },
45
+ }
46
+ const { getByTestId } = render(
47
+ <AppDataPanel state={state} onSelectBridge={() => {}} isRuntimeRunning={false} />,
48
+ )
49
+ const text = getByTestId('appdata-panel').textContent ?? ''
50
+ expect(
51
+ text.includes('未运行'),
52
+ `expected the per-bridge empty state to signal the session is not running; got: "${text}"`,
53
+ ).toBe(true)
54
+ })
55
+
37
56
  it('keeps the existing "暂无页面数据" copy (unchanged) once running', () => {
38
57
  const { getByTestId, getByText } = render(<AppDataPanel {...makeProps(true)} />)
39
58
  expect(getByText('暂无页面数据(仅显示 Page 级 data)')).toBeTruthy()
@@ -132,7 +132,7 @@ export function AppDataPanel({
132
132
  >
133
133
  {keys.length === 0 ? (
134
134
  <div className="text-[12px] text-text-dim text-center px-4 py-6">
135
- 暂无页面数据(仅显示 Page 级 data)
135
+ {isRuntimeRunning ? '暂无页面数据(仅显示 Page 级 data)' : '小程序未运行'}
136
136
  </div>
137
137
  ) : (
138
138
  keys.map((comp) => (
@@ -5,7 +5,10 @@
5
5
  // in-page compile-service callback, or anything else.
6
6
  import type { CompileEvent, CompileLogEntry } from './compile-types.js'
7
7
 
8
- /** The seed payload: both stores, chronological (oldest first). */
8
+ /** The seed payload: both stores, chronological (oldest first). Cross-stream
9
+ * order between an event and a log sharing the same millisecond `at` is only
10
+ * preserved when the host stamps `seq` itself — an unstamped snapshot gets
11
+ * `seq` assigned per store (events first), so such ties sort event-first. */
9
12
  export interface CompileFeedSnapshot {
10
13
  events: CompileEvent[]
11
14
  logs: CompileLogEntry[]