Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
cf7a7b7
adjusting height correctly
meganrm Nov 14, 2025
459b2da
button stays in the same spot
meganrm Nov 15, 2025
a938ba5
remove commented out code
meganrm Nov 15, 2025
203214b
Merge branch 'main' into fix/vertical-spacing
meganrm Nov 15, 2025
8310931
remove ref
meganrm Nov 15, 2025
c1ca39a
Merge branch 'fix/vertical-spacing' of https://github.com/AllenCell/c…
meganrm Nov 15, 2025
628c093
fix bug
meganrm Nov 15, 2025
92d558d
Update src/components/PackingInput/index.tsx
meganrm Nov 15, 2025
524fc37
Update src/components/PackingInput/index.tsx
meganrm Nov 15, 2025
19abf91
re-order imports
meganrm Nov 15, 2025
9b71b89
Merge branch 'fix/vertical-spacing' of https://github.com/AllenCell/c…
meganrm Nov 15, 2025
9335fc8
scroll within recipe container
meganrm Nov 17, 2025
bcf948c
maintain height
meganrm Nov 18, 2025
58b0902
remove sider height
meganrm Nov 18, 2025
275167c
isLoading and isModified selectors and and edits field to PackingResult
interim17 Nov 18, 2025
aee1ec0
add viewer overlay for loading, packing and modified states
interim17 Nov 18, 2025
cbcc139
uselayouteffect
meganrm Nov 18, 2025
b6378ba
remove function
meganrm Nov 19, 2025
d9c63c0
wrap app with div that assigns dark-theme and light-theme class names
interim17 Nov 19, 2025
9bc6c78
Merge branch 'fix/vertical-spacing' of https://github.com/mesoscope/c…
interim17 Nov 19, 2025
e1dc68a
Update src/state/store.ts
interim17 Nov 19, 2025
c5b209d
Merge branch 'main' of https://github.com/mesoscope/cellpack-client i…
interim17 Nov 19, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { getFirebaseRecipe, jsonToString } from "./utils/recipeLoader";
import { getSubmitPackingUrl, JOB_STATUS } from "./constants/aws";
import { FIRESTORE_FIELDS } from "./constants/firebase";
import {
useCurrentRecipeData,
useJobId,
useJobLogs,
useOutputsDirectory,
Expand All @@ -32,6 +33,7 @@ function App() {
const setPackingResults = useSetPackingResults();
const runTime = useRunTime();
const outputDir = useOutputsDirectory();
const edits = useCurrentRecipeData()?.edits || {};

let start = 0;

Expand Down Expand Up @@ -143,6 +145,7 @@ function App() {
resultUrl: localJobStatus.result_path,
runTime: range,
outputDir: localJobStatus.outputs_directory,
edits: edits,
});
} else if (localJobStatus.status == JOB_STATUS.FAILED) {
setPackingResults({
Expand All @@ -151,6 +154,7 @@ function App() {
resultUrl: "",
runTime: range,
outputDir: "",
edits: {}
});
}
};
Expand Down
4 changes: 3 additions & 1 deletion src/components/PackingInput/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
useCurrentRecipeObject,
useInputOptions,
useLoadInputOptions,
useIsLoading,
} from "../../state/store";
import Dropdown from "../Dropdown";
import JSONViewer from "../JSONViewer";
Expand All @@ -29,6 +30,7 @@ const PackingInput = (props: PackingInputProps): JSX.Element => {
const selectedRecipeId = useSelectedRecipeId();
const recipeObj = useCurrentRecipeObject();
const inputOptions = useInputOptions();
const isLoading = useIsLoading();

const loadInputOptions = useLoadInputOptions();
const loadAllRecipes = useLoadAllRecipes();
Expand All @@ -52,7 +54,7 @@ const PackingInput = (props: PackingInputProps): JSX.Element => {
const loadingText = <div className="recipe-select">Loading...</div>;

// No recipe or dropdown options to load
if (!recipeObj && !inputOptions[selectedRecipeId]) {
if (isLoading) {
return loadingText;
}

Expand Down
30 changes: 29 additions & 1 deletion src/components/Viewer/index.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,43 @@
import { LoadingOutlined } from "@ant-design/icons";
import { SIMULARIUM_EMBED_URL } from "../../constants/urls";
import { useResultUrl } from "../../state/store";
import { useIsLoading, useIsModified, useIsPacking, useResultUrl } from "../../state/store";
import "./style.css";

const Viewer = (): JSX.Element => {
const resultUrl = useResultUrl();
const isLoading = useIsLoading();
const isPacking = useIsPacking();
const isModified = useIsModified();

const overlayText = isPacking
? "Running..."
: isLoading
? "Loading..."
: isModified
? "Re-run packing to view result"
: "";

const activeState = isLoading || isPacking;
const showOverlay = activeState || isModified;

return (
<div className="viewer-container">
<iframe
className="simularium-embed"
src={`${SIMULARIUM_EMBED_URL}${resultUrl}`}
/>
{showOverlay && (
<div className="viewer-overlay">
<div
className={`overlay-content ${
activeState ? "active" : ""
}`}
>
{activeState && <LoadingOutlined />}
<p>{overlayText}</p>
</div>
</div>
)}
</div>
);
};
Expand Down
32 changes: 32 additions & 0 deletions src/components/Viewer/style.css
Original file line number Diff line number Diff line change
@@ -1,10 +1,42 @@
.viewer-container {
width: 100%;
height: 100%;
position: relative;
}

.simularium-embed {
width: 100%;
height: 100%;
border: 1px solid black;
}

.viewer-overlay {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: #DCDDE5;
display: flex;
align-items: center;
justify-content: center;
z-index: 10;
}

.overlay-content {
color: #989898;
font-size: 32px;
text-align: center;
}

.overlay-content.active {
color: #468ADE;
}

.dark-theme .viewer-overlay {
background-color: #2C2F38;
}

.dark-theme .overlay-content.active {
color: #8b91ff;
}
1 change: 1 addition & 0 deletions src/state/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ export const EMPTY_PACKING_RESULT: PackingResult = Object.freeze({
resultUrl: "",
runTime: 0,
outputDir: "",
edits: {},
});
14 changes: 14 additions & 0 deletions src/state/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,20 @@ export const useFieldsToDisplay = () =>
export const useRecipes = () => useRecipeStore((s) => s.recipes);
export const usePackingResults = () => useRecipeStore((s) => s.packingResults);

export const useIsLoading = () => {
const recipeObj = useCurrentRecipeData();
const selectedRecipeId = useSelectedRecipeId();
const inputOptions = useInputOptions();
return !recipeObj && !inputOptions[selectedRecipeId];
};

export const useIsModified = () => {
const recipeObj = useCurrentRecipeData();
const packingResults = useCurrentPackingResult();
if (!recipeObj || !packingResults) return false;
return !isEqual(recipeObj.edits, packingResults.edits);
}

export const useCurrentRecipeObject = () => {
const recipe = useCurrentRecipeData();
return recipe
Expand Down
4 changes: 3 additions & 1 deletion src/style/themeRoot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ export function ThemeRoot({ children }: { children: React.ReactNode }) {

return (
<ConfigProvider theme={isDark ? darkTheme : lightTheme}>
{children}
<div className={isDark ? "dark-theme" : "light-theme"}>
{children}
</div>
</ConfigProvider>
);
}
1 change: 1 addition & 0 deletions src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export type PackingResult = {
resultUrl: string;
runTime: number;
outputDir: string;
edits: Record<string, string | number>;
};

export type EditableField = {
Expand Down