@flamingo-stack/openframe-frontend-core 0.0.217-snapshot.20260601003634 → 0.0.217

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flamingo-stack/openframe-frontend-core",
3
- "version": "0.0.217-snapshot.20260601003634",
3
+ "version": "0.0.217",
4
4
  "description": "Shared design system and components for all Flamingo platforms",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -88,18 +88,13 @@ export function useTicketEngagements(
88
88
  const identity = useChatIdentity()
89
89
  const identityKey = identity.user?.email ?? 'anon'
90
90
 
91
- // "Will this ticket fetch its timeline once identity is ready?" — i.e. it's a
92
- // real, non-optimistic ticket the caller enabled. INDEPENDENT of whether
93
- // identity has resolved yet, so the loading state is correct from the very
94
- // first render (before `useChatIdentity` settles).
95
- const fetchable =
91
+ const queryEnabled =
96
92
  enabled &&
93
+ identity.authTier !== 'anon' &&
94
+ !!identity.user?.email &&
97
95
  !!externalTicketId &&
98
96
  !externalTicketId.startsWith('temp-') // optimistic placeholders have no real id yet
99
97
 
100
- const queryEnabled =
101
- fetchable && identity.authTier !== 'anon' && !!identity.user?.email
102
-
103
98
  const query = useQuery({
104
99
  queryKey: ['ticket-engagements', externalTicketId, identityKey],
105
100
  enabled: queryEnabled,
@@ -131,22 +126,7 @@ export function useTicketEngagements(
131
126
 
132
127
  return {
133
128
  engagements: query.data ?? [],
134
- // Loading-state truth that prevents the "body → blink → skeleton → data"
135
- // double-flash. The bug: `useChatIdentity` starts at anon defaults and
136
- // resolves async, so on the first render `queryEnabled` is false and the
137
- // OLD `queryEnabled && query.isLoading` returned FALSE — the panel rendered
138
- // the ticket body, THEN identity resolved, the query enabled, isLoading
139
- // flipped true → skeleton appeared (the blink), then data landed.
140
- //
141
- // Fix: for a fetchable ticket we are "loading" whenever we don't yet have
142
- // the timeline to show — that includes the window while identity is still
143
- // resolving (so we skeleton from the FIRST render, never the body) AND the
144
- // cold query fetch (`data === undefined`). A background poll keeps
145
- // `query.data` defined, so it never re-flashes the skeleton. Non-fetchable
146
- // (optimistic/disabled) or a resolved-anon viewer → not loading.
147
- isLoading:
148
- fetchable &&
149
- (identity.isLoading || (queryEnabled && query.data === undefined)),
129
+ isLoading: queryEnabled && query.isLoading,
150
130
  isFetching: query.isFetching,
151
131
  error: (query.error as Error | null) ?? null,
152
132
  refetch: () => {