BlueSky & more on desktop lazurite.stormlightlabs.org/
tauri rust typescript bluesky appview atproto solid
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

refactor: remove dupes and dead code

+64 -133
+3 -3
src/components/Session.tsx
··· 15 15 ); 16 16 } 17 17 18 - export function SessionExpiredState(props: { account: AccountSummary }) { 18 + function SessionExpiredState(props: { account: AccountSummary }) { 19 19 return ( 20 20 <div class="flex items-center gap-4 [align-content:start] grid-cols-[auto_minmax(0,1fr)]"> 21 21 <AvatarBadge label={props.account.handle || props.account.did} src={props.account.avatar} tone="muted" /> ··· 30 30 ); 31 31 } 32 32 33 - export function SessionProfile(props: { session: ActiveSession; activeAccount: AccountSummary | null }) { 33 + function SessionProfile(props: { session: ActiveSession; activeAccount: AccountSummary | null }) { 34 34 return ( 35 35 <div class="grid items-center gap-4 [align-content:start] grid-cols-[auto_minmax(0,1fr)]"> 36 36 <AvatarBadge label={props.session.handle} src={props.activeAccount?.avatar} tone="primary" /> ··· 88 88 ); 89 89 } 90 90 91 - export function SessionBody( 91 + function SessionBody( 92 92 props: { 93 93 activeSession: ActiveSession | null; 94 94 activeAccount: AccountSummary | null;
+2 -2
src/components/actors/actor-search.tsx
··· 3 3 import type { ActorSuggestion } from "$/lib/types"; 4 4 import { type Accessor, createEffect, createSignal, For, onCleanup, onMount, Show } from "solid-js"; 5 5 6 - export const ACTOR_TYPEAHEAD_DEBOUNCE_MS = 180; 6 + const ACTOR_TYPEAHEAD_DEBOUNCE_MS = 180; 7 7 8 8 type UseActorSuggestionsOptions = { 9 9 container: Accessor<HTMLElement | undefined>; ··· 13 13 value: Accessor<string>; 14 14 }; 15 15 16 - export function normalizeActorSuggestionQuery(value: string) { 16 + function normalizeActorSuggestionQuery(value: string) { 17 17 const trimmed = value.trim(); 18 18 if (trimmed.length < 2 || trimmed.startsWith("did:") || /^https?:\/\//i.test(trimmed)) { 19 19 return "";
-9
src/components/deck/ExplorerColumn.tsx
··· 1 - import { ExplorerPanel } from "$/components/explorer/ExplorerPanel"; 2 - 3 - export function ExplorerColumn() { 4 - return ( 5 - <div class="min-h-0 min-w-0 overflow-hidden"> 6 - <ExplorerPanel /> 7 - </div> 8 - ); 9 - }
+2 -12
src/components/deck/types.ts
··· 3 3 DiagnosticsColumnConfig, 4 4 ExplorerColumnConfig, 5 5 FeedColumnConfig, 6 - MessagesColumnConfig, 7 6 ProfileColumnConfig, 8 7 SearchColumnConfig, 9 8 } from "$/lib/api/types/columns"; ··· 58 57 } 59 58 } 60 59 61 - export function parseExplorerConfig(config: string): ExplorerColumnConfig | null { 60 + function parseExplorerConfig(config: string): ExplorerColumnConfig | null { 62 61 try { 63 62 const parsed = JSON.parse(config) as unknown; 64 63 if (parsed && typeof parsed === "object" && "targetUri" in parsed) { ··· 82 81 } 83 82 } 84 83 85 - export function parseMessagesConfig(config: string): MessagesColumnConfig | null { 86 - try { 87 - const parsed = JSON.parse(config) as unknown; 88 - return parsed && typeof parsed === "object" ? parsed as MessagesColumnConfig : null; 89 - } catch { 90 - return null; 91 - } 92 - } 93 - 94 84 export function parseSearchConfig(config: string): SearchColumnConfig | null { 95 85 try { 96 86 const parsed = JSON.parse(config) as unknown; ··· 115 105 } 116 106 } 117 107 118 - export function feedConfigToSavedFeedItem(config: FeedColumnConfig): SavedFeedItem { 108 + function feedConfigToSavedFeedItem(config: FeedColumnConfig): SavedFeedItem { 119 109 return { 120 110 id: config.feedUri || "following", 121 111 pinned: false,
+1 -1
src/components/deck/useFeedColumnState.ts
··· 8 8 9 9 const PAGE_LIMIT = 20; 10 10 11 - export type FeedColumnState = { 11 + type FeedColumnState = { 12 12 bookmarkPendingByUri: Record<string, boolean>; 13 13 cursor: string | null; 14 14 error: string | null;
-2
src/components/explorer/explorer-state.ts
··· 129 129 getBreadcrumb, 130 130 }; 131 131 } 132 - 133 - export type ExplorerStore = ReturnType<typeof createExplorerState>;
+1 -1
src/components/feeds/FeedComposer.tsx
··· 46 46 onTextChange: (value: string) => void; 47 47 }; 48 48 49 - export type ComposerSurfaceProps = Omit<FeedComposerProps, "open"> & { layout?: "dialog" | "window" }; 49 + type ComposerSurfaceProps = Omit<FeedComposerProps, "open"> & { layout?: "dialog" | "window" }; 50 50 51 51 export function FeedComposer(props: FeedComposerProps) { 52 52 return (
+1 -1
src/components/feeds/types.ts
··· 8 8 loadingMore: boolean; 9 9 }; 10 10 11 - export type ComposerState = { 11 + type ComposerState = { 12 12 open: boolean; 13 13 pending: boolean; 14 14 quoteTarget: PostView | null;
+1 -1
src/components/feeds/useFeedWorkspaceController.ts
··· 37 37 upsertFeedViewPrefs, 38 38 } from "./workspace-state"; 39 39 40 - export type FeedWorkspaceProps = { 40 + type FeedWorkspaceProps = { 41 41 activeSession: ActiveSession; 42 42 onError: (message: string) => void; 43 43 onOpenThread: (uri: string) => void;
+1 -1
src/components/profile/profile-state.ts
··· 1 1 import type { ProfileTab } from "$/lib/profile"; 2 2 import type { FeedViewPost, ProfileLookupUnavailable, ProfileViewBasic, ProfileViewDetailed } from "$/lib/types"; 3 3 4 - export type FeedState = { 4 + type FeedState = { 5 5 cursor: string | null; 6 6 error: string | null; 7 7 items: FeedViewPost[];
+2 -2
src/components/search/PostSearchFilters.tsx
··· 1 - import type { NetworkSearchSort } from "$/lib/search-routes"; 1 + import type { NetworkSearchSort } from "$/lib/api/search"; 2 2 import { normalizeTagToken, type PostSearchFilters } from "$/lib/search-routes"; 3 3 import { createEffect, createMemo, createSignal, For, Show } from "solid-js"; 4 4 import { ArrowIcon, Icon } from "../shared/Icon"; ··· 14 14 onChange: (next: Partial<PostSearchFilters>) => void; 15 15 }; 16 16 17 - export function SearchSortTabs(props: SearchSortTabsProps) { 17 + function SearchSortTabs(props: SearchSortTabsProps) { 18 18 return ( 19 19 <div class="flex items-center gap-2" role="tablist" aria-label="Post search sort"> 20 20 <For each={["top", "latest"] as const}>
+1 -1
src/components/shared/Icon.tsx
··· 2 2 import type { ExplorerTargetKind } from "$/lib/api/types/explorer"; 3 3 import { type JSX, Match, splitProps, Switch } from "solid-js"; 4 4 5 - export type ActionIconKind = "add" | "edit" | "delete" | "save" | "cancel"; 5 + type ActionIconKind = "add" | "edit" | "delete" | "save" | "cancel"; 6 6 7 7 export type SettingsIconKind = 8 8 | "computer"
+7 -7
src/lib/api/diagnostics.ts
··· 77 77 total?: number | null; 78 78 }; 79 79 80 - export type AccountListsResult = { lists: DiagnosticList[]; total: number; truncated: boolean }; 81 - export type AccountLabelsResult = { 80 + type AccountListsResult = { lists: DiagnosticList[]; total: number; truncated: boolean }; 81 + type AccountLabelsResult = { 82 82 labels: DiagnosticLabel[]; 83 83 sourceProfiles: Record<string, unknown>; 84 84 cursor: string | null; 85 85 }; 86 - export type AccountBlockedByResult = { items: DiagnosticDidProfile[]; total: number; cursor: string | null }; 86 + type AccountBlockedByResult = { items: DiagnosticDidProfile[]; total: number; cursor: string | null }; 87 87 88 - export type AccountBlockingItem = DiagnosticBlockItem; 88 + type AccountBlockingItem = DiagnosticBlockItem; 89 89 90 - export type AccountBlockingResult = { items: AccountBlockingItem[]; cursor: string | null }; 90 + type AccountBlockingResult = { items: AccountBlockingItem[]; cursor: string | null }; 91 91 92 - export type AccountStarterPacksResult = { starterPacks: DiagnosticStarterPack[]; total: number; truncated: boolean }; 92 + type AccountStarterPacksResult = { starterPacks: DiagnosticStarterPack[]; total: number; truncated: boolean }; 93 93 94 - export type RecordBacklinksResult = { 94 + type RecordBacklinksResult = { 95 95 likes: DiagnosticBacklinkGroup; 96 96 reposts: DiagnosticBacklinkGroup; 97 97 replies: DiagnosticBacklinkGroup;
+1 -27
src/lib/api/search.ts
··· 27 27 28 28 export type ActorSearchResult = { cursor?: string | null; actors: ActorResult[] }; 29 29 30 - type TStarterPack = { 31 - uri: string; 32 - cid: string; 33 - record: { name: string; description?: string; createdAt: string }; 34 - creator: { did: string; handle: string; displayName?: string | null; avatar?: string | null }; 35 - indexedAt: string; 36 - }; 37 - 38 - export type StarterPackSearchResult = { cursor?: string | null; starterPacks: Array<TStarterPack> }; 39 - 40 30 export type SavedPostSource = "like" | "bookmark"; 41 31 42 32 export type LocalPostResult = { ··· 52 42 semanticMatch: boolean; 53 43 }; 54 44 55 - export type SavedPostsPage = { posts: LocalPostResult[]; total: number; nextOffset?: number | null }; 45 + type SavedPostsPage = { posts: LocalPostResult[]; total: number; nextOffset?: number | null }; 56 46 57 47 export type SyncStatus = { 58 48 did: string; ··· 111 101 return invoke("search_actors", { query, limit: limit ?? null, cursor: cursor ?? null }); 112 102 } 113 103 114 - export function searchStarterPacks( 115 - query: string, 116 - limit?: number, 117 - cursor?: string | null, 118 - ): Promise<StarterPackSearchResult> { 119 - return invoke("search_starter_packs", { query, limit: limit ?? null, cursor: cursor ?? null }); 120 - } 121 - 122 104 export function syncPosts(did: string, source: SavedPostSource): Promise<SyncStatus> { 123 105 return invoke("sync_posts", { did, source }); 124 106 } ··· 127 109 return invoke("get_sync_status", { did }); 128 110 } 129 111 130 - export function embedPendingPosts(): Promise<number> { 131 - return invoke("embed_pending_posts"); 132 - } 133 - 134 112 export function reindexEmbeddings(): Promise<number> { 135 113 return invoke("reindex_embeddings"); 136 114 } ··· 141 119 142 120 export function setEmbeddingsPreflightSeen(seen: boolean): Promise<void> { 143 121 return invoke("set_embeddings_preflight_seen", { seen }); 144 - } 145 - 146 - export function getEmbeddingsEnabled(): Promise<boolean> { 147 - return invoke("get_embeddings_enabled"); 148 122 } 149 123 150 124 export function getEmbeddingsConfig(): Promise<EmbeddingsConfig> {
+1 -1
src/lib/api/settings.ts
··· 28 28 } 29 29 } 30 30 31 - export function resetApp() { 31 + function resetApp() { 32 32 return invoke("reset_app"); 33 33 } 34 34
-2
src/lib/api/types/columns.ts
··· 20 20 21 21 export type DiagnosticsColumnConfig = { did: string }; 22 22 23 - export type MessagesColumnConfig = Record<string, never>; 24 - 25 23 export type SearchColumnConfig = { mode: SearchMode; query: string }; 26 24 27 25 export type ProfileColumnConfig = {
+2 -2
src/lib/api/types/explorer.ts
··· 1 - export type ExplorerInputKind = "atUri" | "handle" | "did" | "pdsUrl"; 1 + type ExplorerInputKind = "atUri" | "handle" | "did" | "pdsUrl"; 2 2 3 3 export type ExplorerTargetKind = "pds" | "repo" | "collection" | "record"; 4 4 ··· 17 17 18 18 export type ExplorerNavigation = { target: ResolvedExplorerInput }; 19 19 20 - export type ExplorerHostedRepo = { did: string; head: string; rev: string; active: boolean; status: string | null }; 20 + type ExplorerHostedRepo = { did: string; head: string; rev: string; active: boolean; status: string | null }; 21 21 22 22 export type ExplorerServerView = { 23 23 pdsUrl: string;
+1 -1
src/lib/conversations.ts
··· 1 - export const MESSAGES_ROUTE = "/messages"; 1 + const MESSAGES_ROUTE = "/messages"; 2 2 3 3 export function buildMessagesRoute(memberDid?: string | null) { 4 4 const trimmed = memberDid?.trim();
+7 -25
src/lib/feeds.ts
··· 20 20 } from "./types"; 21 21 22 22 export const TIMELINE_ROUTE = "/timeline"; 23 - export const THREAD_QUERY_PARAM = "thread"; 23 + const THREAD_QUERY_PARAM = "thread"; 24 24 25 - export function asPostRecord(value: unknown): PostRecord { 25 + function asPostRecord(value: unknown): PostRecord { 26 26 return (asRecord(value) ?? {}) as PostRecord; 27 27 } 28 28 ··· 181 181 }; 182 182 } 183 183 184 - export function isRepostReason(item: FeedViewPost) { 184 + function isRepostReason(item: FeedViewPost) { 185 185 return item.reason?.$type === "app.bsky.feed.defs#reasonRepost"; 186 186 } 187 187 188 - export function isQuoteEmbed(embed: Maybe<EmbedView>) { 188 + function isQuoteEmbed(embed: Maybe<EmbedView>) { 189 189 return embed?.$type === "app.bsky.embed.record#view" || embed?.$type === "app.bsky.embed.recordWithMedia#view"; 190 190 } 191 191 ··· 198 198 return !!asRecord(record?.reply); 199 199 } 200 200 201 - export function isReplyByUnfollowed(item: FeedViewPost) { 201 + function isReplyByUnfollowed(item: FeedViewPost) { 202 202 return isReplyItem(item) && !item.post.author.viewer?.following; 203 203 } 204 204 205 - export function getRootRef(item: FeedViewPost) { 206 - if (item.reply?.root.$type === "app.bsky.feed.defs#postView") { 207 - return toStrongRef(item.reply.root); 208 - } 209 - 210 - return toStrongRef(item.post); 211 - } 212 - 213 205 export function getReplyRootPost(item: FeedViewPost) { 214 206 if (item.reply?.root.$type === "app.bsky.feed.defs#postView") { 215 207 return item.reply.root; ··· 220 212 221 213 export function toStrongRef(post: PostView) { 222 214 return { cid: post.cid, uri: post.uri } satisfies StrongRefInput; 223 - } 224 - 225 - export function canUseStrongRef( 226 - post: Maybe<FeedReplyNode | ThreadNode>, 227 - ): post is { $type: "app.bsky.feed.defs#postView" } & PostView { 228 - return !!post && "$type" in post && post.$type === "app.bsky.feed.defs#postView"; 229 215 } 230 216 231 217 export function isThreadViewPost(node: Maybe<ThreadNode>): node is ThreadViewPost { ··· 296 282 }); 297 283 } 298 284 299 - export function getQuotedRecord(embed: Maybe<EmbedView>) { 285 + function getQuotedRecord(embed: Maybe<EmbedView>) { 300 286 if (!embed) { 301 287 return null; 302 288 } ··· 355 341 return node.post; 356 342 } 357 343 358 - export function encodeThreadRouteUri(uri: string) { 359 - return encodeURIComponent(uri); 360 - } 361 - 362 344 export function decodeThreadRouteUri(value: Maybe<string>) { 363 345 if (!value) { 364 346 return null; ··· 396 378 return buildPublicPostHref(post.author, post.uri) ?? post.uri; 397 379 } 398 380 399 - export function buildPublicPostHref(author: Maybe<ProfileViewBasic>, uri: Maybe<string>) { 381 + function buildPublicPostHref(author: Maybe<ProfileViewBasic>, uri: Maybe<string>) { 400 382 if (!author || typeof uri !== "string") { 401 383 return null; 402 384 }
+1 -1
src/lib/post-events.ts
··· 8 8 viewer?: Partial<ViewerState> | null; 9 9 }; 10 10 11 - export type BookmarkChangedDetail = { bookmarked: boolean; cid: string; uri: string }; 11 + type BookmarkChangedDetail = { bookmarked: boolean; cid: string; uri: string }; 12 12 13 13 export function emitPostViewUpdated(detail: PostViewUpdateDetail) { 14 14 globalThis.dispatchEvent(new CustomEvent<PostViewUpdateDetail>(POST_VIEW_UPDATED_EVENT, { detail }));
+1 -1
src/lib/profile.ts
··· 37 37 return actor.handle?.trim() || actor.did; 38 38 } 39 39 40 - export function parseProfile(value: unknown): ProfileViewDetailed { 40 + function parseProfile(value: unknown): ProfileViewDetailed { 41 41 const record = asRecord(value); 42 42 if (!record || typeof record.did !== "string" || typeof record.handle !== "string") { 43 43 throw new Error("profile payload is invalid");
+5 -6
src/lib/search-routes.ts
··· 1 - import type { SearchMode } from "$/lib/api/search"; 1 + import type { NetworkSearchSort, SearchMode } from "$/lib/api/search"; 2 2 3 3 export type SearchTab = "posts" | "profiles"; 4 - export type NetworkSearchSort = "top" | "latest"; 5 - export const SEARCH_ROUTE = "/search"; 6 - export const SEARCH_PREFLIGHT_ROUTE = "/search/preflight"; 4 + const SEARCH_ROUTE = "/search"; 5 + const SEARCH_PREFLIGHT_ROUTE = "/search/preflight"; 7 6 8 7 export type PostSearchFilters = { 9 8 author: string; ··· 14 13 until: string; 15 14 }; 16 15 17 - export type SearchRouteState = PostSearchFilters & { mode: SearchMode; q: string; tab: SearchTab }; 16 + type SearchRouteState = PostSearchFilters & { mode: SearchMode; q: string; tab: SearchTab }; 18 17 19 18 const CONTROLLED_POST_SEARCH_PARAMS = ["author", "mentions", "since", "sort", "tags", "until"] as const; 20 19 const SEARCH_ROUTE_DEFAULTS: SearchRouteState = { ··· 107 106 return normalized ? `#${normalized}` : "#"; 108 107 } 109 108 110 - export function normalizeDateInput(value?: string | null) { 109 + function normalizeDateInput(value?: string | null) { 111 110 const trimmed = value?.trim() ?? ""; 112 111 if (!SEARCH_DATE_PATTERN.test(trimmed)) { 113 112 return "";
+18 -18
src/lib/types.ts
··· 10 10 11 11 export type LoginSuggestion = ActorSuggestion; 12 12 13 - export type SavedFeedKind = "timeline" | "feed" | "list"; 13 + type SavedFeedKind = "timeline" | "feed" | "list"; 14 14 15 15 export type SavedFeedItem = { id: string; type: SavedFeedKind; value: string; pinned: boolean }; 16 16 ··· 27 27 28 28 export type UserPreferences = { savedFeeds: SavedFeedItem[]; feedViewPrefs: FeedViewPrefs }; 29 29 30 - export type AuthorViewerState = { following?: string | null }; 30 + type AuthorViewerState = { following?: string | null }; 31 31 32 32 export type ProfileViewBasic = { 33 33 did: string; ··· 38 38 viewer?: AuthorViewerState | null; 39 39 }; 40 40 41 - export type ProfileViewerState = { 41 + type ProfileViewerState = { 42 42 blockedBy?: boolean | null; 43 43 followedBy?: string | null; 44 44 following?: string | null; ··· 61 61 website?: string | null; 62 62 }; 63 63 64 - export type ProfileLookupAvailable = { status: "available"; profile: ProfileViewDetailed }; 64 + type ProfileLookupAvailable = { status: "available"; profile: ProfileViewDetailed }; 65 65 66 66 export type ProfileLookupUnavailable = { 67 67 status: "unavailable"; ··· 106 106 [key: string]: unknown; 107 107 }; 108 108 109 - export type RichTextByteSlice = { byteEnd: number; byteStart: number }; 109 + type RichTextByteSlice = { byteEnd: number; byteStart: number }; 110 110 111 - export type RichTextLinkFacet = { $type: "app.bsky.richtext.facet#link"; uri: string }; 111 + type RichTextLinkFacet = { $type: "app.bsky.richtext.facet#link"; uri: string }; 112 112 113 - export type RichTextMentionFacet = { $type: "app.bsky.richtext.facet#mention"; did: string }; 113 + type RichTextMentionFacet = { $type: "app.bsky.richtext.facet#mention"; did: string }; 114 114 115 - export type RichTextTagFacet = { $type: "app.bsky.richtext.facet#tag"; tag: string }; 115 + type RichTextTagFacet = { $type: "app.bsky.richtext.facet#tag"; tag: string }; 116 116 117 117 export type RichTextFacetFeature = RichTextLinkFacet | RichTextMentionFacet | RichTextTagFacet; 118 118 ··· 122 122 123 123 export type ImagesEmbedView = { $type: "app.bsky.embed.images#view"; images: Array<ImageEmbed> }; 124 124 125 - export type ExternalEmbedView = { 125 + type ExternalEmbedView = { 126 126 $type: "app.bsky.embed.external#view"; 127 127 external: { description?: string; thumb?: string; title?: string; uri?: string }; 128 128 }; 129 129 130 - export type EmbeddedQuoteRecord = { 130 + type EmbeddedQuoteRecord = { 131 131 $type?: string; 132 132 author?: ProfileViewBasic; 133 133 cid?: string; ··· 136 136 value?: Record<string, unknown>; 137 137 }; 138 138 139 - export type RecordEmbedView = { $type: "app.bsky.embed.record#view"; record: EmbeddedQuoteRecord }; 139 + type RecordEmbedView = { $type: "app.bsky.embed.record#view"; record: EmbeddedQuoteRecord }; 140 140 141 - export type RecordWithMediaEmbedView = { 141 + type RecordWithMediaEmbedView = { 142 142 $type: "app.bsky.embed.recordWithMedia#view"; 143 143 media?: EmbedView; 144 144 record?: RecordEmbedView; 145 145 }; 146 146 147 - export type VideoEmbedView = { 147 + type VideoEmbedView = { 148 148 $type: "app.bsky.embed.video#view"; 149 149 alt?: string; 150 150 aspectRatio?: { height: number; width: number }; ··· 184 184 185 185 export type FeedReplyNode = ({ $type: "app.bsky.feed.defs#postView" } & PostView) | NotFoundPost | BlockedPost; 186 186 187 - export type FeedReplyRef = { grandparentAuthor?: ProfileViewBasic | null; parent: FeedReplyNode; root: FeedReplyNode }; 187 + type FeedReplyRef = { grandparentAuthor?: ProfileViewBasic | null; parent: FeedReplyNode; root: FeedReplyNode }; 188 188 189 - export type FeedReasonRepost = { 189 + type FeedReasonRepost = { 190 190 $type: "app.bsky.feed.defs#reasonRepost"; 191 191 by: ProfileViewBasic; 192 192 cid?: string | null; ··· 194 194 uri?: string | null; 195 195 }; 196 196 197 - export type FeedReasonPin = { $type: "app.bsky.feed.defs#reasonPin" }; 197 + type FeedReasonPin = { $type: "app.bsky.feed.defs#reasonPin" }; 198 198 199 199 export type FeedViewPost = { 200 200 feedContext?: string | null; ··· 282 282 283 283 export type Theme = "light" | "dark" | "auto"; 284 284 285 - export type MessageViewSender = { did: string }; 285 + type MessageViewSender = { did: string }; 286 286 287 287 export type MessageView = { 288 288 $type?: "chat.bsky.convo.defs#messageView"; ··· 301 301 sentAt: string; 302 302 }; 303 303 304 - export type ConvoLastMessage = MessageView | DeletedMessageView; 304 + type ConvoLastMessage = MessageView | DeletedMessageView; 305 305 306 306 export type ConvoView = { 307 307 id: string;
-3
src/lib/utils/numbers.ts
··· 1 - export function clamp(value: number, min: number, max: number) { 2 - return Math.min(Math.max(value, min), max); 3 - }
+3 -3
src/test/providers.tsx
··· 39 39 downloadActive: false, 40 40 }; 41 41 42 - export function createAppSessionTestValue(overrides: Partial<AppSessionContextValue> = {}): AppSessionContextValue { 42 + function createAppSessionTestValue(overrides: Partial<AppSessionContextValue> = {}): AppSessionContextValue { 43 43 const accounts = overrides.accounts ?? [DEFAULT_ACCOUNT]; 44 44 const activeSession = overrides.activeSession === undefined ? DEFAULT_SESSION : overrides.activeSession; 45 45 const activeAccount = overrides.activeAccount === undefined ··· 79 79 }; 80 80 } 81 81 82 - export function createAppShellUiTestValue(overrides: Partial<AppShellUiContextValue> = {}): AppShellUiContextValue { 82 + function createAppShellUiTestValue(overrides: Partial<AppShellUiContextValue> = {}): AppShellUiContextValue { 83 83 return { 84 84 narrowViewport: overrides.narrowViewport ?? false, 85 85 railCollapsed: overrides.railCollapsed ?? false, ··· 92 92 }; 93 93 } 94 94 95 - export function createAppPreferencesTestValue( 95 + function createAppPreferencesTestValue( 96 96 overrides: Partial<AppPreferencesContextValue> = {}, 97 97 ): AppPreferencesContextValue { 98 98 return {
+2
src/test/setup.ts
··· 1 + // fallow-ignore-file unused-file 2 + 1 3 import { cleanup } from "@solidjs/testing-library"; 2 4 import "@testing-library/jest-dom/vitest"; 3 5 import { Dynamic } from "solid-js/web";