@wyxos/vibe 3.1.7 → 3.1.8

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"
@@ -298,7 +294,6 @@ type VibeStatus = {
298
294
  hasPreviousPage: boolean
299
295
  itemCount: number
300
296
  loadState: 'failed' | 'loaded' | 'loading'
301
- mode: 'dynamic' | 'static'
302
297
  nextBoundaryLoadProgress: number
303
298
  nextCursor: string | null
304
299
  pageLoadingLocked: boolean
@@ -402,8 +397,7 @@ Routes:
402
397
 
403
398
  - `/` - default feed surface
404
399
  - `/documentation` - in-app documentation
405
- - `/demo/dynamic-feed` - dynamic feed fill-loop demo
406
- - `/demo/advanced-integration` - static feed, removals, and paging-lock demo
400
+ - `/demo/feed-behavior` - unified fill, retry, boundary refresh, removals, and paging-lock demo
407
401
  - `/debug/fake-server` - fake-server inspection route
408
402
 
409
403
  ## 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 {
@@ -15,7 +14,6 @@ export interface VibeStatus {
15
14
  hasPreviousPage: boolean;
16
15
  itemCount: number;
17
16
  loadState: 'failed' | 'loaded' | 'loading';
18
- mode: VibeFeedMode;
19
17
  nextBoundaryLoadProgress: number;
20
18
  nextCursor: string | null;
21
19
  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;
@@ -37,7 +36,6 @@ export declare function useAutoResolveSource(options: {
37
36
  items: import("vue").ComputedRef<VibeViewerItem[]>;
38
37
  lockPageLoading: () => void;
39
38
  loading: import("vue").ComputedRef<boolean>;
40
- mode: import("vue").ComputedRef<VibeFeedMode>;
41
39
  maybePrefetchAround: () => Promise<void>;
42
40
  nextCursor: import("vue").ComputedRef<string | null>;
43
41
  pendingAppendItems: import("vue").ComputedRef<VibeViewerItem[]>;
@@ -26,7 +26,6 @@ export declare function useController(props: Readonly<VibeProps>, emit: VibeEmit
26
26
  readonly hasPreviousPage: boolean;
27
27
  readonly itemCount: number;
28
28
  readonly loadState: "failed" | "loaded" | "loading";
29
- readonly mode: import("./removalState").VibeFeedMode;
30
29
  readonly nextBoundaryLoadProgress: number;
31
30
  readonly nextCursor: string | null;
32
31
  readonly pageLoadingLocked: boolean;
@@ -55,7 +54,6 @@ export declare function useController(props: Readonly<VibeProps>, emit: VibeEmit
55
54
  isPageLoadingLocked: import("vue").Ref<boolean, boolean>;
56
55
  items: import("vue").ComputedRef<import("../viewer").VibeViewerItem[]>;
57
56
  loading: import("vue").ComputedRef<boolean>;
58
- mode: import("vue").ComputedRef<import("./removalState").VibeFeedMode>;
59
57
  nextCursor: import("vue").ComputedRef<string | null>;
60
58
  paginationDetail: import("vue").ComputedRef<string | null>;
61
59
  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>;
@@ -60,7 +59,6 @@ export declare function useDataSource(props: Readonly<VibeProps>, emit: VibeEmit
60
59
  loading: import("vue").ComputedRef<boolean>;
61
60
  loadNext: () => Promise<void>;
62
61
  loadPrevious: () => Promise<void>;
63
- mode: import("vue").ComputedRef<import("./removalState").VibeFeedMode>;
64
62
  nextCursor: import("vue").ComputedRef<string | null>;
65
63
  paginationDetail: import("vue").ComputedRef<string | null>;
66
64
  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';