Move character ordering and AI Trump category in 3D presets

Storyboy, Story Girl, Knight, and News Anchor are now pinned to the
front of the Characters row in that order. AI Trump is moved from
Characters into Memes. Both are resolved client-side after the featured
items fetch by matching on lowercased item names.
This commit is contained in:
Tanish Manku committed 2026-03-25 00:41:29 -07:00
1 parent 389b1c3d17
commit d204050d94
6 files changed
+278 -111

No files matched your search

Generated
+7 -7
View File
@@ -557,9 +557,9 @@ dependencies = [
[[package]]
name = "anstream"
version = "0.6.14"
version = "0.6.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "418c75fa768af9c03be99d17643f93f79bbba589895012a80e3452a19ddda15b"
checksum = "43d5b281e737544384e969a5ccad3f1cdd24b48086a0fc1b2a5262a26b8f4f4a"
dependencies = [
"anstyle",
"anstyle-parse",
@@ -3273,7 +3273,7 @@ dependencies = [
"libc",
"option-ext",
"redox_users",
"windows-sys 0.61.2",
"windows-sys 0.59.0",
]
[[package]]
@@ -6302,7 +6302,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34"
dependencies = [
"cfg-if",
"windows-targets 0.52.6",
"windows-targets 0.48.5",
]
[[package]]
@@ -9777,7 +9777,7 @@ dependencies = [
"errno",
"libc",
"linux-raw-sys 0.12.1",
"windows-sys 0.61.2",
"windows-sys 0.59.0",
]
[[package]]
@@ -9894,7 +9894,7 @@ dependencies = [
"security-framework 3.7.0",
"security-framework-sys",
"webpki-root-certs",
"windows-sys 0.61.2",
"windows-sys 0.59.0",
]
[[package]]
@@ -12152,7 +12152,7 @@ dependencies = [
"getrandom 0.4.1",
"once_cell",
"rustix 1.1.4",
"windows-sys 0.61.2",
"windows-sys 0.59.0",
]
[[package]]
@@ -343,10 +343,10 @@
"markdownDescription": "Denies the fetch_send command without any pre-configured scope."
},
{
"description": "This permission set configures what kind of\nfetch operations are available from the http plugin.\n\nThis enables all fetch operations but does not\nallow explicitly any origins to be fetched. This needs to\nbe manually configured before usage.\n\n#### Granted Permissions\n\nAll fetch operations are enabled.\n\n\n#### This default permission set includes:\n\n- `allow-fetch`\n- `allow-fetch-cancel`\n- `allow-fetch-read-body`\n- `allow-fetch-send`",
"description": "This permission set configures what kind of\r\nfetch operations are available from the http plugin.\r\n\r\nThis enables all fetch operations but does not\r\nallow explicitly any origins to be fetched. This needs to\r\nbe manually configured before usage.\r\n\r\n#### Granted Permissions\r\n\r\nAll fetch operations are enabled.\r\n\r\n\n#### This default permission set includes:\n\n- `allow-fetch`\n- `allow-fetch-cancel`\n- `allow-fetch-read-body`\n- `allow-fetch-send`",
"type": "string",
"const": "default",
"markdownDescription": "This permission set configures what kind of\nfetch operations are available from the http plugin.\n\nThis enables all fetch operations but does not\nallow explicitly any origins to be fetched. This needs to\nbe manually configured before usage.\n\n#### Granted Permissions\n\nAll fetch operations are enabled.\n\n\n#### This default permission set includes:\n\n- `allow-fetch`\n- `allow-fetch-cancel`\n- `allow-fetch-read-body`\n- `allow-fetch-send`"
"markdownDescription": "This permission set configures what kind of\r\nfetch operations are available from the http plugin.\r\n\r\nThis enables all fetch operations but does not\r\nallow explicitly any origins to be fetched. This needs to\r\nbe manually configured before usage.\r\n\r\n#### Granted Permissions\r\n\r\nAll fetch operations are enabled.\r\n\r\n\n#### This default permission set includes:\n\n- `allow-fetch`\n- `allow-fetch-cancel`\n- `allow-fetch-read-body`\n- `allow-fetch-send`"
}
]
}
@@ -38,14 +38,13 @@ export const loadPreviewOnCanvas = ({
const camera = new THREE.PerspectiveCamera(35, aspectRatio, 0.1, 1000);
camera.position.z = 2;
const gl2ctx = canvas.getContext("webgl2");
const gl2ctx = canvas.getContext("webgl2", { preserveDrawingBuffer: true });
const renderer = new THREE.WebGLRenderer({
alpha: true,
antialias: true,
canvas: canvas,
context: gl2ctx!,
preserveDrawingBuffer: true,
});
renderer.setSize(width, height);
@@ -126,14 +126,19 @@ export const UploadFilesSplat = ({
useEffect(() => {
if (previewStatus.type === "OK" && canvasRef.current) {
snapshotCanvasAsThumbnail({
targetNode: canvasRef.current!,
resultCallback: (snapshotBlob) => {
if (snapshotBlob) {
setThumbnailFile(snapshotBlob);
}
},
const canvas = canvasRef.current;
// Defer one animation frame so the splat renderer has produced a visible frame
const rafId = requestAnimationFrame(() => {
snapshotCanvasAsThumbnail({
targetNode: canvas,
resultCallback: (snapshotBlob) => {
if (snapshotBlob) {
setThumbnailFile(snapshotBlob);
}
},
});
});
return () => cancelAnimationFrame(rafId);
}
}, [previewStatus]);
@@ -97,6 +97,11 @@ const categoryToTabIdMap: Record<FilterEngineCategories, string> = {
[FilterEngineCategories.VIDEO_PLANE]: "all",
};
// Names (lowercase) to pin to the front of the characters list, in order.
const CHARACTER_PRIORITY_ORDER = ["storyboy", "story girl", "knight", "news anchor"];
// Names (lowercase) of featured characters that should appear in Memes instead.
const MEME_OVERRIDES = ["ai trump"];
export const AssetModal = () => {
useSignals();
const [activeLibraryTab, setActiveLibraryTab] = useState("library");
@@ -253,8 +258,35 @@ export const AssetModal = () => {
// { id: "mine", label: "Mine" },
// ];
const assetTabs = useMemo<AssetTab[]>(
() => [
const assetTabs = useMemo<AssetTab[]>(() => {
const allCharacterCandidates =
activeLibraryTab === "library"
? [...demoCharacterItems.value, ...(featuredCharacters ?? [])]
: (userCharacters ?? []);
// Split out items that belong in Memes
const memeOverrideItems = allCharacterCandidates.filter((item) =>
MEME_OVERRIDES.includes(item.name?.toLowerCase() ?? ""),
);
const characterCandidates = allCharacterCandidates.filter(
(item) => !MEME_OVERRIDES.includes(item.name?.toLowerCase() ?? ""),
);
// Reorder: priority names first (in specified order), then the rest
const priorityCharacters: MediaItem[] = [];
for (const name of CHARACTER_PRIORITY_ORDER) {
const found = characterCandidates.find(
(item) => item.name?.toLowerCase() === name,
);
if (found) priorityCharacters.push(found);
}
const remainingCharacters = characterCandidates.filter(
(item) =>
!CHARACTER_PRIORITY_ORDER.includes(item.name?.toLowerCase() ?? ""),
);
const orderedCharacters = [...priorityCharacters, ...remainingCharacters];
return [
{ id: "all", label: "All", icon: faLayerGroup, items: [] },
{
id: "character",
@@ -262,10 +294,7 @@ export const AssetModal = () => {
labelSingle: "Character",
icon: faUser,
engineCategory: FilterEngineCategories.CHARACTER,
items:
activeLibraryTab === "library"
? [...demoCharacterItems.value, ...(featuredCharacters ?? [])]
: (userCharacters ?? []),
items: orderedCharacters,
},
{
id: "objects",
@@ -284,7 +313,10 @@ export const AssetModal = () => {
labelSingle: "Meme",
icon: faFaceGrinStars,
engineCategory: FilterEngineCategories.CHARACTER,
items: activeLibraryTab === "library" ? demoMemeItems.value : [],
items:
activeLibraryTab === "library"
? [...demoMemeItems.value, ...memeOverrideItems]
: [],
},
{
id: "sets",
@@ -326,7 +358,8 @@ export const AssetModal = () => {
// ? (featuredImagePlanes ?? [])
// : (userImagePlanes ?? []),
// },
],
];
},
// eslint-disable-next-line react-hooks/exhaustive-deps
[
activeLibraryTab,
+215 -85
View File
File diff suppressed because it is too large. Load diff