Compare commits

...
Author SHA1 Message Date
Michael Chung cc739e3359 Ok so I fixed the gallery modal it shouldn't use the cdn anymore.
since the json object already has the url in the response. I am surprised this even worked.
2025-05-01 15:40:51 -04:00
Michael Chung 8440ea9505 Ok need to check if tbe cdn works.
Made fix to index.tsx to use the new fetch proxy.
2025-05-01 15:09:32 -04:00
Michael Chung 62127ab9d3 Added run run_desktop_3d 2025-05-01 14:15:39 -04:00
6 changed files with 55 additions and 16 deletions
+14
View File
@@ -0,0 +1,14 @@
#!/usr/bin/env bash
# Get the directory of this script
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# Go up to the root of the repository (assumes src/app/pages is always 3 levels deep)
REPO_ROOT="$(cd "${SCRIPT_DIR}/../../.." && pwd)"
cd "${REPO_ROOT}"
echo "${REPO_ROOT}"
# Run the launch script
./script/desktop/launch_desktop_2d.sh
+1 -1
View File
@@ -9,7 +9,7 @@ import { Toaster } from "~/components/ui/Toast";
import { JobProvider } from "~/components/JobContext";
import "./global.css";
import { useRenderCounter } from "~/hooks/useRenderCounter";
import { FetchProxy as fetch } from "@storyteller/tauri-utils";
function PostHogInit() {
const apiKey = import.meta.env.VITE_POSTHOG_API_KEY;
posthog.init(apiKey, {
@@ -8,7 +8,6 @@ import { CloseButton } from "@storyteller/ui-close-button";
import { LoadingSpinner } from "@storyteller/ui-loading-spinner";
import React, { useState, useEffect, useCallback, useMemo } from "react";
import {
GetCdnOrigin,
FilterMediaClasses,
GalleryModalApi,
UsersApi,
@@ -63,7 +62,7 @@ export const GalleryModal = React.memo(
const [isLightboxVisible, setIsLightboxVisible] = useState(false);
const [failedImageUrls] = useState<Set<string>>(new Set());
const [username, setUsername] = useState<string>("");
const cdnOrigin = GetCdnOrigin();
const imageUrl = lightboxImage?.fullImage || "";
const api = useMemo(() => new GalleryModalApi(), []);
const usersApi = useMemo(() => new UsersApi(), []);
@@ -107,16 +106,6 @@ export const GalleryModal = React.memo(
[failedImageUrls]
);
const getImageUrl = useCallback(
(path: string | undefined | null) => {
if (!path) return null;
const normalizedPath = path.startsWith("/") ? path : `/${path}`;
const url = `${cdnOrigin}${normalizedPath}`;
return failedImageUrls.has(url) ? null : url;
},
[cdnOrigin, failedImageUrls]
);
useEffect(() => {
const getUsername = async () => {
const session = await usersApi.GetSession();
@@ -142,8 +131,8 @@ export const GalleryModal = React.memo(
const newItems = response.data.map((item: any) => ({
id: item.token,
label: item.maybe_title || "Image Generation",
thumbnail: getImageUrl(item.public_bucket_path),
fullImage: getImageUrl(item.public_bucket_path),
thumbnail: item.thumbnail,
fullImage: item.fullImage,
createdAt: item.created_at,
}));
setGroupedItems(groupItemsByDate(newItems));
+2 -1
View File
@@ -23,7 +23,8 @@ config_path="${rust_crate_path}/tauri.artcraft_3d.no_dev.conf.toml"
export TAURI_FRONTEND_PATH="${frontend_path}"
export TAURI_APP_PATH="${rust_crate_path}"
cargo tauri dev --no-dev-server \
RUSTFLAGS="-Awarnings" cargo tauri dev --no-dev-server \
--no-dev-server-wait \
--no-watch \
--config "${config_path}"
+7
View File
@@ -0,0 +1,7 @@
set -euxo pipefail
# calls these
./script/desktop/run_desktop_3d_frontend.sh
./script/desktop/launch_rust_only_3d.sh
echo "All scripts completed!"
+28
View File
@@ -0,0 +1,28 @@
set -euxo pipefail
root_dir=$(pwd)
frontend_path="${root_dir}/frontend"
rust_crate_path="${root_dir}/crates/desktop/tauri-artcraft"
# The tauri dev server integration is super annoying: It eats ctrl-c interrupts,
# it decoheres the and corrupts terminal output, and it's slow. This configuration
# allows us to start without it. Simply launch `nx` and the dev server as a separate
# process and leave tauri out of the loop
config_path="${rust_crate_path}/tauri.artcraft_3d.no_dev.conf.toml"
export TAURI_FRONTEND_PATH="${frontend_path}"
export TAURI_APP_PATH="${rust_crate_path}"
# Kill any process running on port 5741, which will block startup
if lsof -i tcp:5173 &>/dev/null; then
lsof -i tcp:5173 -t | xargs kill -9
echo "Killed process running on port 5173"
else
echo "No process running on port 5173"
fi
# Launch nx dev editor3d in the background
(cd "$frontend_path" && npx nx dev editor3d &)