@opengeni/react 0.8.0 → 0.9.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.
- package/README.md +8 -0
- package/dist/index.d.ts +5 -2
- package/dist/index.js +9 -3
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/hooks/use-session-capabilities.ts +3 -2
- package/src/hooks/use-session-events.ts +14 -3
package/README.md
CHANGED
|
@@ -149,6 +149,14 @@ so consumers can render attachment chips. `groupTimeline` clusters consecutive
|
|
|
149
149
|
activity for collapsed display. Use them directly if you want custom rendering
|
|
150
150
|
with the same semantics.
|
|
151
151
|
|
|
152
|
+
### Compatibility
|
|
153
|
+
|
|
154
|
+
The projection is a tolerant reader over `SessionEvent.payload` because the wire
|
|
155
|
+
contract intentionally keeps payloads open. Unknown event types and unknown or
|
|
156
|
+
malformed fields are ignored, never fatal. The golden event-grammar suite in
|
|
157
|
+
`test/golden` is the compatibility contract for how existing durable logs render;
|
|
158
|
+
intentional changes should regenerate those snapshots and review the diff.
|
|
159
|
+
|
|
152
160
|
## Components
|
|
153
161
|
|
|
154
162
|
- `ChatComposer` — auto-growing textarea, Enter-to-send (IME-safe), stop
|
package/dist/index.d.ts
CHANGED
|
@@ -505,6 +505,8 @@ type UseSessionEventsResult = {
|
|
|
505
505
|
connectionState: SessionEventsConnectionState;
|
|
506
506
|
/** Highest sequence seen so far (0 before the first event). */
|
|
507
507
|
lastSequence: number;
|
|
508
|
+
/** True until the initial tail window has been applied (windowed mode). */
|
|
509
|
+
initialLoading: boolean;
|
|
508
510
|
/** Whether older durable events are available before the current window. */
|
|
509
511
|
hasOlder: boolean;
|
|
510
512
|
/** True while an older window is being fetched. */
|
|
@@ -939,8 +941,9 @@ type UseSessionCapabilitiesOptions = ClientOverride & {
|
|
|
939
941
|
warmingPollMs?: number | undefined;
|
|
940
942
|
/**
|
|
941
943
|
* Give up waiting for `warm` after this long while polling (ms) and surface a
|
|
942
|
-
* stalled error with a manual `renegotiate`. Default 30000
|
|
943
|
-
*
|
|
944
|
+
* stalled error with a manual `renegotiate`. Default 30000. This is a UI
|
|
945
|
+
* patience deadline, independent from the worker's sandbox warming timeout.
|
|
946
|
+
* 0 disables the deadline.
|
|
944
947
|
*/
|
|
945
948
|
warmingDeadlineMs?: number | undefined;
|
|
946
949
|
};
|
package/dist/index.js
CHANGED
|
@@ -2756,8 +2756,7 @@ function formatDurationFacet(durationMs) {
|
|
|
2756
2756
|
|
|
2757
2757
|
// src/hooks/use-session-events.ts
|
|
2758
2758
|
var TAIL_PAGE_SIZE = 5e3;
|
|
2759
|
-
var
|
|
2760
|
-
var INITIAL_FETCH_CAP = 3;
|
|
2759
|
+
var INITIAL_FETCH_CAP = 1;
|
|
2761
2760
|
var OLDER_GROUP_TARGET = 32;
|
|
2762
2761
|
var OLDER_FETCH_CAP = 2;
|
|
2763
2762
|
var BOUNDARY_PAGE_CAP = 4;
|
|
@@ -2771,6 +2770,7 @@ function useSessionEvents(sessionId, options = {}) {
|
|
|
2771
2770
|
const [connectionState, setConnectionState] = useState8("idle");
|
|
2772
2771
|
const [error, setError] = useState8(null);
|
|
2773
2772
|
const [hasOlder, setHasOlder] = useState8(false);
|
|
2773
|
+
const [initialLoading, setInitialLoading] = useState8(true);
|
|
2774
2774
|
const [loadingOlder, setLoadingOlder] = useState8(false);
|
|
2775
2775
|
const lastSequenceRef = useRef2(after);
|
|
2776
2776
|
const oldestSequenceRef = useRef2(null);
|
|
@@ -2787,6 +2787,7 @@ function useSessionEvents(sessionId, options = {}) {
|
|
|
2787
2787
|
setError(null);
|
|
2788
2788
|
setHasOlder(false);
|
|
2789
2789
|
setLoadingOlder(false);
|
|
2790
|
+
setInitialLoading(true);
|
|
2790
2791
|
lastSequenceRef.current = after;
|
|
2791
2792
|
oldestSequenceRef.current = null;
|
|
2792
2793
|
hasOlderRef.current = false;
|
|
@@ -2822,7 +2823,7 @@ function useSessionEvents(sessionId, options = {}) {
|
|
|
2822
2823
|
const window2 = await loadEventWindow(client, workspaceId, sessionId, {
|
|
2823
2824
|
before: Number.MAX_SAFE_INTEGER,
|
|
2824
2825
|
pageSize: TAIL_PAGE_SIZE,
|
|
2825
|
-
targetGroups:
|
|
2826
|
+
targetGroups: Number.POSITIVE_INFINITY,
|
|
2826
2827
|
maxFetches: INITIAL_FETCH_CAP,
|
|
2827
2828
|
signal: controller.signal
|
|
2828
2829
|
});
|
|
@@ -2834,6 +2835,10 @@ function useSessionEvents(sessionId, options = {}) {
|
|
|
2834
2835
|
lastSequenceRef.current = window2.newestSequence;
|
|
2835
2836
|
setHasOlder(window2.hasOlder);
|
|
2836
2837
|
setEvents(window2.events);
|
|
2838
|
+
setInitialLoading(false);
|
|
2839
|
+
}
|
|
2840
|
+
if (fullReplay) {
|
|
2841
|
+
setInitialLoading(false);
|
|
2837
2842
|
}
|
|
2838
2843
|
const stream = client.streamEvents(workspaceId, sessionId, {
|
|
2839
2844
|
after: lastSequenceRef.current,
|
|
@@ -2919,6 +2924,7 @@ function useSessionEvents(sessionId, options = {}) {
|
|
|
2919
2924
|
sessionStatus,
|
|
2920
2925
|
connectionState,
|
|
2921
2926
|
lastSequence: lastSequenceRef.current,
|
|
2927
|
+
initialLoading: fullReplay ? false : initialLoading,
|
|
2922
2928
|
hasOlder: fullReplay ? false : hasOlder,
|
|
2923
2929
|
loadingOlder: fullReplay ? false : loadingOlder,
|
|
2924
2930
|
loadOlder,
|