@wyxos/vibe 3.1.7 → 3.1.9

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 CHANGED
@@ -147,28 +147,24 @@ Vibe owns:
147
147
  - initial retry state
148
148
  - removal-aware feed navigation
149
149
 
150
- ### Feed strategies
151
-
152
- Vibe supports two feed strategies:
153
-
154
- - `dynamic`:
155
- - default behavior
156
- - if a resolve returns fewer items than `pageSize`, Vibe enters a fill loop
157
- - it waits `fillDelayMs`, then `fillDelayMs + fillDelayStepMs`, and so on for each chained request
158
- - it keeps accumulating results until the collected count reaches `pageSize` or there is no further cursor
159
- - then it commits that batch into the layout once
160
- - when the trailing edge is exhausted, another bottom-edge attempt reloads the trailing cursor so newly available pages can be discovered
161
- - `static`:
162
- - before advancing at the bottom or top, Vibe checks whether the current boundary page is underfilled after local removals
163
- - if it is, Vibe reloads that same cursor in place first
164
- - only once that boundary page is full again will the next edge hit advance to the next or previous cursor
150
+ ### Default paging behavior
151
+
152
+ Vibe has one built-in paging model:
153
+
154
+ - if a resolve returns fewer visible items than `pageSize`, Vibe enters a fill loop
155
+ - it waits `fillDelayMs`, then `fillDelayMs + fillDelayStepMs`, and so on for each chained request
156
+ - it keeps accumulating results until the collected count reaches `pageSize` or there is no further cursor
157
+ - then it commits that batch into the layout once
158
+ - before advancing at the bottom or top, Vibe checks whether the current boundary page is underfilled after local removals
159
+ - if it is, Vibe reloads that same cursor in place first and reconciles only that page's content in the grid
160
+ - if that boundary refresh comes back empty, the same boundary attempt can continue to the next or previous cursor
161
+ - when the trailing edge is exhausted, another bottom-edge attempt reloads the trailing cursor so newly available pages can be discovered
165
162
 
166
163
  Example:
167
164
 
168
165
  ```vue
169
166
  <VibeLayout
170
167
  :resolve="resolve"
171
- mode="dynamic"
172
168
  :page-size="25"
173
169
  :fill-delay-ms="2000"
174
170
  :fill-delay-step-ms="1000"
@@ -292,13 +288,13 @@ type VibeStatus = {
292
288
  currentCursor: string | null
293
289
  errorMessage: string | null
294
290
  fillCollectedCount: number | null
291
+ fillCursor: string | null
295
292
  fillDelayRemainingMs: number | null
296
293
  fillTargetCount: number | null
297
294
  hasNextPage: boolean
298
295
  hasPreviousPage: boolean
299
296
  itemCount: number
300
297
  loadState: 'failed' | 'loaded' | 'loading'
301
- mode: 'dynamic' | 'static'
302
298
  nextBoundaryLoadProgress: number
303
299
  nextCursor: string | null
304
300
  pageLoadingLocked: boolean
@@ -402,8 +398,7 @@ Routes:
402
398
 
403
399
  - `/` - default feed surface
404
400
  - `/documentation` - in-app documentation
405
- - `/demo/dynamic-feed` - dynamic feed fill-loop demo
406
- - `/demo/advanced-integration` - static feed, removals, and paging-lock demo
401
+ - `/demo/feed-behavior` - unified fill, retry, boundary refresh, removals, and paging-lock demo
407
402
  - `/debug/fake-server` - fake-server inspection route
408
403
 
409
404
  ## Local development
@@ -47,4 +47,4 @@ export declare function hydrateAutoResolveState(options: {
47
47
  };
48
48
  export declare function getActiveOccurrenceKey(items: VibeViewerItem[], activeIndex: number): string | null;
49
49
  export declare function getSyncedActiveIndex(items: VibeViewerItem[], activeIndex: number, anchorOccurrenceKey?: string | null): number;
50
- export declare function isStaticBoundaryUnderfilled(bucket: VibeAutoBucket | null, removedIds: Set<string>, pageSize: number): boolean;
50
+ export declare function isBoundaryPageUnderfilled(bucket: VibeAutoBucket | null, removedIds: Set<string>, pageSize: number): boolean;
@@ -1,7 +1,7 @@
1
- export declare const DEFAULT_DYNAMIC_FILL_DELAY_MS = 2000;
2
- export declare const DEFAULT_DYNAMIC_FILL_DELAY_STEP_MS = 1000;
3
- export declare function getDynamicFillDelayMs(fillRequestIndex: number, baseDelayMs?: number, stepDelayMs?: number): number;
4
- export declare function normalizeDynamicFillDelayMs(value: number | undefined, fallback: number): number;
1
+ export declare const DEFAULT_FILL_DELAY_MS = 2000;
2
+ export declare const DEFAULT_FILL_DELAY_STEP_MS = 1000;
3
+ export declare function getFillDelayMs(fillRequestIndex: number, baseDelayMs?: number, stepDelayMs?: number): number;
4
+ export declare function normalizeFillDelayMs(value: number | undefined, fallback: number): number;
5
5
  export declare function useFillDelayCountdown(): {
6
6
  clear: (resolvePending?: boolean) => void;
7
7
  remainingMs: import("vue").Ref<number | null, number | null>;
@@ -1,7 +1,6 @@
1
1
  export interface VibeRemoveResult {
2
2
  ids: string[];
3
3
  }
4
- export type VibeFeedMode = 'dynamic' | 'static';
5
4
  export type VibeLoadPhase = 'failed' | 'filling' | 'idle' | 'initializing' | 'loading' | 'refreshing';
6
5
  export type VibeSurfaceMode = 'fullscreen' | 'list';
7
6
  export interface VibeStatus {
@@ -9,13 +8,13 @@ export interface VibeStatus {
9
8
  currentCursor: string | null;
10
9
  errorMessage: string | null;
11
10
  fillCollectedCount: number | null;
11
+ fillCursor: string | null;
12
12
  fillDelayRemainingMs: number | null;
13
13
  fillTargetCount: number | null;
14
14
  hasNextPage: boolean;
15
15
  hasPreviousPage: boolean;
16
16
  itemCount: number;
17
17
  loadState: 'failed' | 'loaded' | 'loading';
18
- mode: VibeFeedMode;
19
18
  nextBoundaryLoadProgress: number;
20
19
  nextCursor: string | null;
21
20
  pageLoadingLocked: boolean;
@@ -1,6 +1,6 @@
1
1
  import { type Ref } from 'vue';
2
2
  import type { VibeViewerItem } from '../viewer';
3
- import type { VibeFeedMode, VibeLoadPhase } from './removalState';
3
+ import type { VibeLoadPhase } from './removalState';
4
4
  import { type ResolveFn } from './autoResolveHelpers';
5
5
  type VibeAutoEmit = (event: 'update:activeIndex', value: number) => void;
6
6
  export declare function useAutoResolveSource(options: {
@@ -15,7 +15,6 @@ export declare function useAutoResolveSource(options: {
15
15
  nextCursor?: string | null;
16
16
  previousCursor?: string | null;
17
17
  };
18
- mode?: VibeFeedMode;
19
18
  pageSize?: number;
20
19
  removedIds: Ref<Set<string>>;
21
20
  resolve?: ResolveFn;
@@ -28,6 +27,7 @@ export declare function useAutoResolveSource(options: {
28
27
  currentCursor: import("vue").ComputedRef<string | null>;
29
28
  errorMessage: Ref<string | null, string | null>;
30
29
  fillCollectedCount: Ref<number | null, number | null>;
30
+ fillCursor: Ref<string | null, string | null>;
31
31
  fillDelayRemainingMs: Ref<number | null, number | null>;
32
32
  fillTargetCount: Ref<number | null, number | null>;
33
33
  hasNextPage: import("vue").ComputedRef<boolean>;
@@ -37,7 +37,6 @@ export declare function useAutoResolveSource(options: {
37
37
  items: import("vue").ComputedRef<VibeViewerItem[]>;
38
38
  lockPageLoading: () => void;
39
39
  loading: import("vue").ComputedRef<boolean>;
40
- mode: import("vue").ComputedRef<VibeFeedMode>;
41
40
  maybePrefetchAround: () => Promise<void>;
42
41
  nextCursor: import("vue").ComputedRef<string | null>;
43
42
  pendingAppendItems: import("vue").ComputedRef<VibeViewerItem[]>;
@@ -20,13 +20,13 @@ export declare function useController(props: Readonly<VibeProps>, emit: VibeEmit
20
20
  readonly currentCursor: string | null;
21
21
  readonly errorMessage: string | null;
22
22
  readonly fillCollectedCount: number | null;
23
+ readonly fillCursor: string | null;
23
24
  readonly fillDelayRemainingMs: number | null;
24
25
  readonly fillTargetCount: number | null;
25
26
  readonly hasNextPage: boolean;
26
27
  readonly hasPreviousPage: boolean;
27
28
  readonly itemCount: number;
28
29
  readonly loadState: "failed" | "loaded" | "loading";
29
- readonly mode: import("./removalState").VibeFeedMode;
30
30
  readonly nextBoundaryLoadProgress: number;
31
31
  readonly nextCursor: string | null;
32
32
  readonly pageLoadingLocked: boolean;
@@ -47,6 +47,7 @@ export declare function useController(props: Readonly<VibeProps>, emit: VibeEmit
47
47
  currentCursor: import("vue").ComputedRef<string | null>;
48
48
  errorMessage: import("vue").Ref<string | null, string | null>;
49
49
  fillCollectedCount: import("vue").Ref<number | null, number | null>;
50
+ fillCursor: import("vue").Ref<string | null, string | null>;
50
51
  fillDelayRemainingMs: import("vue").Ref<number | null, number | null>;
51
52
  fillTargetCount: import("vue").Ref<number | null, number | null>;
52
53
  getRemovedIds: () => string[];
@@ -55,7 +56,6 @@ export declare function useController(props: Readonly<VibeProps>, emit: VibeEmit
55
56
  isPageLoadingLocked: import("vue").Ref<boolean, boolean>;
56
57
  items: import("vue").ComputedRef<import("../viewer").VibeViewerItem[]>;
57
58
  loading: import("vue").ComputedRef<boolean>;
58
- mode: import("vue").ComputedRef<import("./removalState").VibeFeedMode>;
59
59
  nextCursor: import("vue").ComputedRef<string | null>;
60
60
  paginationDetail: import("vue").ComputedRef<string | null>;
61
61
  pendingAppendItems: import("vue").ComputedRef<import("../viewer").VibeViewerItem[]>;
@@ -1,7 +1,7 @@
1
1
  import type { VibeViewerItem } from '../viewer';
2
2
  import type { VibeEmptyStateMode } from './surfaceSlots';
3
3
  export type { VibeHandle, VibeRemoveResult } from './removalState';
4
- export type { VibeFeedMode, VibeLoadPhase, VibeSurfaceMode } from './removalState';
4
+ export type { VibeLoadPhase, VibeSurfaceMode } from './removalState';
5
5
  export interface VibeResolveParams {
6
6
  cursor: string | null;
7
7
  pageSize: number;
@@ -26,7 +26,6 @@ export interface VibeProps {
26
26
  initialCursor?: string | null;
27
27
  initialState?: VibeInitialState;
28
28
  loopFullscreenVideo?: boolean;
29
- mode?: import('./removalState').VibeFeedMode;
30
29
  pageSize?: number;
31
30
  paginationDetail?: string | null;
32
31
  resolve?: (params: VibeResolveParams) => Promise<VibeResolveResult>;
@@ -49,6 +48,7 @@ export declare function useDataSource(props: Readonly<VibeProps>, emit: VibeEmit
49
48
  currentCursor: import("vue").ComputedRef<string | null>;
50
49
  errorMessage: import("vue").Ref<string | null, string | null>;
51
50
  fillCollectedCount: import("vue").Ref<number | null, number | null>;
51
+ fillCursor: import("vue").Ref<string | null, string | null>;
52
52
  fillDelayRemainingMs: import("vue").Ref<number | null, number | null>;
53
53
  fillTargetCount: import("vue").Ref<number | null, number | null>;
54
54
  getRemovedIds: () => string[];
@@ -60,7 +60,6 @@ export declare function useDataSource(props: Readonly<VibeProps>, emit: VibeEmit
60
60
  loading: import("vue").ComputedRef<boolean>;
61
61
  loadNext: () => Promise<void>;
62
62
  loadPrevious: () => Promise<void>;
63
- mode: import("vue").ComputedRef<import("./removalState").VibeFeedMode>;
64
63
  nextCursor: import("vue").ComputedRef<string | null>;
65
64
  paginationDetail: import("vue").ComputedRef<string | null>;
66
65
  pendingAppendItems: import("vue").ComputedRef<VibeViewerItem[]>;
@@ -3,7 +3,7 @@ import type { VibeViewerItem } from '../viewer';
3
3
  import type { VibeAssetErrorReporter, VibeAssetLoadReporter } from './assetErrors';
4
4
  import { formatPlaybackTime } from './format';
5
5
  import type { VibeLoadPhase } from './removalState';
6
- export type { VibeResolveParams, VibeResolveResult, VibeEmit, VibeFeedMode, VibeHandle, VibeInitialState, VibeLoadPhase, VibeProps, VibeSurfaceMode, } from './useDataSource';
6
+ export type { VibeResolveParams, VibeResolveResult, VibeEmit, VibeHandle, VibeInitialState, VibeLoadPhase, VibeProps, VibeSurfaceMode, } from './useDataSource';
7
7
  export type { VibeAssetErrorKind } from './loadError';
8
8
  export type { VibeStatus } from './removalState';
9
9
  export type { VibeAssetErrorEvent, VibeAssetErrorReporter, VibeAssetErrorSurface, VibeAssetLoadEvent, VibeAssetLoadReporter, VibeAssetLoadSurface } from './assetErrors';