Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
3f95b20
UI post-refactor revisions pass 1
itspvty Aug 11, 2025
e43690a
pass 2 fixes
itspvty Aug 12, 2025
d7f4327
pass 3 (pr recs)
itspvty Aug 12, 2025
235c8aa
pass 4
itspvty Aug 12, 2025
9c2a2d4
pass 5 (pr recs)
itspvty Aug 12, 2025
14055bf
chore: rm unused
itspvty Aug 12, 2025
fccc97b
Merge branch 'dev' into aries/2002/fix-ui-appearance
itspvty Aug 12, 2025
70e3b8e
Merge branch 'dev' into aries/2002/fix-ui-appearance
itspvty Aug 15, 2025
97a8314
pass 6 (pr reqs)
itspvty Aug 15, 2025
484a9c2
fix consent screen styling
itspvty Aug 15, 2025
fe96f2f
Merge branch 'dev' into aries/2002/fix-ui-appearance
itspvty Aug 18, 2025
4504a1c
Update fission/src/ui/components/Panel.tsx
itspvty Aug 20, 2025
4edda99
pass 7 (pr reqs)
itspvty Aug 20, 2025
7a550f6
Merge remote-tracking branch 'refs/remotes/upstream/aries/2002/fix-ui…
itspvty Aug 20, 2025
5776e7f
chore: format
itspvty Aug 20, 2025
d6038fe
remove action visual following grabber cursor implementation
itspvty Aug 20, 2025
ab547b2
Merge branch 'dev' into aries/2002/fix-ui-appearance
itspvty Aug 21, 2025
324685e
Merge branch 'dev' into aries/2002/fix-ui-appearance
itspvty Aug 21, 2025
2363db2
pass 8 (reqs)
itspvty Aug 21, 2025
32d8ca0
fix typo
itspvty Aug 21, 2025
8a04272
Merge branch 'dev' into aries/2002/fix-ui-appearance
itspvty Aug 21, 2025
6628bd6
Merge branch 'dev' into aries/2002/fix-ui-appearance
itspvty Aug 21, 2025
8beb904
chore: format
itspvty Aug 21, 2025
0318de3
pass 9 (reqs)
itspvty Aug 21, 2025
796d5b2
chore: formatting
itspvty Aug 21, 2025
f804900
Merge branch 'dev' into aries/2002/fix-ui-appearance
itspvty Aug 21, 2025
6e3cf7e
fix: ui appearance changes
PepperLola Aug 22, 2025
399e93e
Merge branch 'dev' into aries/2002/fix-ui-appearance
PepperLola Aug 23, 2025
71454dc
fix: format and lint
PepperLola Aug 23, 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
7 changes: 6 additions & 1 deletion fission/src/Synthesis.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { AnimatePresence } from "framer-motion"
import { SnackbarProvider } from "notistack"
import Slide from "@mui/material/Slide"
import { useCallback, useEffect, useRef, useState } from "react"
import MainHUD from "@/components/MainHUD"
import Scene from "@/components/Scene.tsx"
Expand Down Expand Up @@ -68,7 +69,11 @@ function Synthesis() {
return (
<AnimatePresence key={"animate-presence"}>
<ThemeProvider>
<SnackbarProvider maxSnack={5} anchorOrigin={{ horizontal: "right", vertical: "bottom" }}>
<SnackbarProvider
maxSnack={5}
anchorOrigin={{ horizontal: "right", vertical: "bottom" }}
TransitionComponent={Slide}
>
<StateProvider>
<UIProvider>
<GlobalUIComponent />
Expand Down
27 changes: 27 additions & 0 deletions fission/src/ui/ThemeProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,33 @@ export const ThemeProvider: React.FC<ThemeProviderProps> = ({ children }) => {
variant: "contained",
},
},
MuiPopover: {
defaultProps: {
elevation: 8,
},
styleOverrides: {
paper: {
boxShadow: "0 4px 8px rgba(0,0,0,0.25), 0 2px 4px rgba(0,0,0,0.2)",
},
},
},
MuiPaper: {
styleOverrides: {
root: {
boxShadow: "0 2px 6px rgba(0,0,0,0.24), 0 1px 3px rgba(0,0,0,0.18)",
},
},
},
MuiMenu: {
defaultProps: {
elevation: 8,
},
styleOverrides: {
paper: {
boxShadow: "0 4px 12px rgba(0,0,0,0.28), 0 2px 6px rgba(0,0,0,0.18)",
},
},
},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about adding something like this? This blurs the background if you have a modal open which I think is better.

Suggested change
},
},
MuiBackdrop: {
styleOverrides: {
root: {
backgroundColor: "rgba(0, 0, 0, 0.5)",
backdropFilter: "blur(2px)",
},
},
},

},
})

Expand Down
23 changes: 22 additions & 1 deletion fission/src/ui/UIProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,13 @@ export const UIProvider: React.FC<UIProviderProps> = ({ children }) => {
props: Omit<PanelProps<P>, "type" | "configured" | "custom"> &
Omit<UIScreenCallbacks<T>, "onBeforeAccept"> = DEFAULT_PANEL_PROPS
) => {
// Dupe check
const isDuplicate = panels.some(p => p.content === content)
if (isDuplicate) {
const existing = panels.find(p => p.content === content)!
setPanels(p => [...p.filter(x => x !== existing), existing])
return existing.id
}
const id = uuidv4()
const panel = {
id,
Expand All @@ -128,7 +135,21 @@ export const UIProvider: React.FC<UIProviderProps> = ({ children }) => {
panel.onCancel = new UICallback()
if (props.onCancel) panel.onCancel.setUserDefinedFunc(props.onCancel)

setPanels([...panels, panel as Panel<any, any>])
const contentName = (content as unknown as { name?: string })?.name ?? ""
const mutuallyExclusive = ["ImportMirabufPanel", "ConfigurePanel"]
const nextPanels = panels
if (mutuallyExclusive.includes(contentName)) {
const existing = panels.find(p =>
mutuallyExclusive.includes((p.content as unknown as { name?: string })?.name ?? "")
)
if (existing) {
// Bring it to front
setPanels(p => [...p.filter(x => x !== existing), existing])
return existing.id
}
}

setPanels([...nextPanels, panel as Panel<any, any>])
return id
},
[panels]
Expand Down
5 changes: 3 additions & 2 deletions fission/src/ui/components/ContextMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,14 @@ const ContextMenu: React.FC = () => {
top: state.location[1],
padding: "1rem",
borderRadius: "0.5rem",
bgcolor: "background.default",
bgcolor: "background.paper",
boxShadow: 6,
}}
// Why, why, why do I need to do this. This is absurd
onPointerDown={e => e.stopPropagation()}
>
<Stack key="CONTEXT-HEADER" component="div" direction="column">
<Label key="context-title" size="md">
<Label key="context-title" size="md" color="text.primary">
{state.data.title}
</Label>
<Divider />
Expand Down
7 changes: 5 additions & 2 deletions fission/src/ui/components/DragModeIndicator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,14 @@ const DragModeIndicator: React.FC = () => {
direction="row"
onClick={handleClick}
sx={{
bgcolor: "background.default",
bgcolor: "background.paper",
boxShadow: 6,
}}
>
<FaHandPaper className="self-center" />
<Label size="sm">Drag Mode</Label>
<Label size="sm" color="text.primary">
Drag Mode
</Label>
</Stack>
) : (
<></>
Expand Down
14 changes: 12 additions & 2 deletions fission/src/ui/components/MainHUD.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,8 @@ const MainHUD: React.FC = () => {
WebkitUserSelect: "none",
filter: mode === "dark" ? "invert(1)" : "none",
}}
draggable={false}
onDragStart={e => e.preventDefault()}
/>
<IconButton
sx={{
Expand All @@ -206,7 +208,11 @@ const MainHUD: React.FC = () => {
value={"Spawn Asset"}
icon={SynthesisIcons.ADD}
larger={true}
onClick={() => openPanel(ImportMirabufPanel, { configurationType: "ROBOTS" as ConfigurationType })}
onClick={() =>
openPanel(ImportMirabufPanel, {
configurationType: "ROBOTS" as ConfigurationType,
})
}
/>
<Stack direction="column" sx={{ borderRadius: "7px", padding: "4px" }} bgcolor="primary.main" gap={0.5}>
<MainHUDButton
Expand All @@ -217,7 +223,11 @@ const MainHUD: React.FC = () => {
<MainHUDButton
value={"General Settings"}
icon={SynthesisIcons.GEAR}
onClick={() => openModal(SettingsModal, undefined, undefined, { allowClickAway: false })}
onClick={() =>
openModal(SettingsModal, undefined, undefined, {
allowClickAway: false,
})
}
/>
<MainHUDButton
value={"Developer Tool"}
Expand Down
26 changes: 21 additions & 5 deletions fission/src/ui/components/Panel.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Button, Card, CardActions, CardContent, CardHeader } from "@mui/material"
import React, { type ReactElement } from "react"
import React, { type ReactElement, useRef } from "react"
import Draggable from "react-draggable"
import {
CloseType,
Expand Down Expand Up @@ -56,21 +56,37 @@ export const Panel = <T, P>({ children, panel, parent }: PanelElementProps<T, P>
const { closePanel } = useUIContext()

const props = panel.props
const nodeRef = useRef<HTMLDivElement | null>(null)

// FIXME: sliders show up as <span> so want to cancel drag on those
// however still can drag on dropdown but menu elements are left behind
return (
<Draggable cancel="span, input" positionOffset={getPositionOffset(props.position)}>
<Draggable
handle=".panel-drag-handle"
cancel={"input, textarea, select, .MuiSlider-root, .MuiMenuItem-root, .no-drag"}
positionOffset={getPositionOffset(props.position)}
nodeRef={nodeRef}
>
<Card
elevation={8}
sx={{
display: panel.props.configured ? "" : "none",
position: "absolute",
pointerEvents: "auto",
p: 4,
p: 2,
boxShadow: 6,
}}
ref={nodeRef}
>
{props.title && <CardHeader title={props.title} className="select-none" />}
<CardContent>
{props.title && (
<CardHeader
title={props.title}
className="panel-drag-handle select-none"
sx={{ cursor: "move", py: 1, px: 2 }}
titleTypographyProps={{ variant: "subtitle1" }}
/>
)}
<CardContent sx={{ p: 2, "&:last-child": { pb: 2 } }}>
<div className="panel-contents">
{React.Children.map(children, child => {
if (React.isValidElement(child)) return React.cloneElement(child, { panel, parent })
Expand Down
12 changes: 9 additions & 3 deletions fission/src/ui/components/Scoreboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Stack } from "@mui/material"
import type React from "react"
import { useCallback, useEffect, useState } from "react"
import Draggable from "react-draggable"
import { useRef } from "react"
import { OnScoreChangedEvent } from "@/mirabuf/ScoringZoneSceneObject"
import MatchMode, { UpdateTimeLeft } from "@/systems/match_mode/MatchMode"
import { MatchModeType } from "@/systems/match_mode/MatchModeTypes"
Expand Down Expand Up @@ -39,16 +40,21 @@ const Scoreboard: React.FC = () => {
}
}, [])

const nodeRef = useRef<HTMLDivElement | null>(null)

return (
<Draggable positionOffset={{ x: HALF_W, y: 0 }}>
<Draggable positionOffset={{ x: HALF_W, y: 0 }} nodeRef={nodeRef}>
<Stack
direction="column"
sx={{ bgcolor: "background.default", position: "absolute" }}
sx={{ bgcolor: "background.paper", position: "absolute", boxShadow: 6 }}
className="w-min p-2 justify-center align-middle rounded-3xl select-none"
ref={nodeRef}
>
{showTime() && (
<Stack direction="row" className="w-full justify-center">
<Label size="lg">{time}</Label>
<Label size="lg" color="text.primary">
{time}
</Label>
</Stack>
)}
<Stack direction="row" className={`px-4 ${showTime() ? "pt-1 pb-4" : "py-4"}`} gap={1}>
Expand Down
5 changes: 3 additions & 2 deletions fission/src/ui/components/SelectMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ const SelectMenu: React.FC<SelectMenuProps> = ({
return (
<>
{/** Box containing the menu header */}
<Stack direction="row" textAlign={"center"} minHeight={"30px"} key="selected-item">
<Stack direction="row" textAlign={"center"} minHeight={"30px"} key="selected-item" gap={1}>
{/** Back arrow button when an option is selected */}
{selectedOption !== undefined && (
<IconButton
Expand All @@ -153,6 +153,7 @@ const SelectMenu: React.FC<SelectMenuProps> = ({
onOptionSelected(undefined)
}}
id="select-menu-back-button"
sx={{ mr: 1 }}
>
{SynthesisIcons.LEFT_ARROW_LARGE}
</IconButton>
Expand All @@ -166,7 +167,7 @@ const SelectMenu: React.FC<SelectMenuProps> = ({
</Stack>
</Stack>
<Divider />
{Spacer(10)}
{Spacer(12)}

{selectedOption === undefined && (
<>
Expand Down
48 changes: 33 additions & 15 deletions fission/src/ui/components/StatefulSlider.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FormControlLabel, Slider, Tooltip } from "@mui/material"
import { Slider, Stack, Tooltip, Typography } from "@mui/material"
import { useState } from "react"

const StatefulSlider: React.FC<
Expand All @@ -12,20 +12,38 @@ const StatefulSlider: React.FC<
const [value, setValue] = useState(props.defaultValue)
return (
<Tooltip title={props.tooltip ?? ""}>
<FormControlLabel
label={props.label}
labelPlacement="top"
control={
<Slider
{...props}
value={value}
onChange={(_, value) => {
setValue(value as number)
props.onChange?.(value as number)
}}
></Slider>
}
/>
<Stack
direction="column"
gap={0.5}
className="no-drag"
sx={{
px: 2,
py: 0.5,
overflow: "hidden",
boxSizing: "border-box",
width: "100%",
}}
>
<Stack direction="row" justifyContent="space-between" alignItems="baseline">
<Typography variant="body2">{props.label}</Typography>
<Typography variant="caption">{value.toFixed(2)}</Typography>
</Stack>
<Slider
{...props}
value={value}
onChange={(_, value) => {
setValue(value as number)
props.onChange?.(value as number)
}}
sx={{
mx: 0,
width: "100%",
"& .MuiSlider-thumb": {
boxShadow: 2,
},
}}
/>
</Stack>
</Tooltip>
)
}
Expand Down
10 changes: 5 additions & 5 deletions fission/src/ui/modals/configuring/SettingsModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@ interface ThemeTabConfig extends TabConfigBase {

type TabConfig = GeneralTabConfig | GraphicsTabConfig | ThemeTabConfig

const ColorEditor: React.FC<{ label: string; color: string; setColor: (_c: string) => void }> = ({
label,
color,
setColor,
}) => {
const ColorEditor: React.FC<{
label: string
color: string
setColor: (_c: string) => void
}> = ({ label, color, setColor }) => {
return (
<Stack direction="row" gap={2}>
<TextField
Expand Down
20 changes: 15 additions & 5 deletions fission/src/ui/panels/DeveloperToolPanel.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Button, Stack } from "@mui/material"
import { Alert, Button, Stack } from "@mui/material"
import type React from "react"
import { useEffect, useRef, useState } from "react"
import MirabufCachingService, { MiraType } from "@/mirabuf/MirabufLoader"
Expand Down Expand Up @@ -221,7 +221,9 @@ const DeveloperToolPanel: React.FC<PanelImplProps<void, void>> = ({ panel }) =>
}
try {
const encoded = mirabuf.Assembly.encode(assembly).finish()
const blob = new Blob([encoded.buffer as ArrayBuffer], { type: "application/octet-stream" })
const blob = new Blob([encoded.buffer as ArrayBuffer], {
type: "application/octet-stream",
})
const url = URL.createObjectURL(blob)

// Check if assembly has devtool data to determine filename
Expand Down Expand Up @@ -254,8 +256,12 @@ const DeveloperToolPanel: React.FC<PanelImplProps<void, void>> = ({ panel }) =>
}, [])

return (
<Stack gap={4} className="rounded-md p-4 max-h-[60vh] min-h-[350px] overflow-y-auto">
{!fieldLoaded && <div className="text-red-600 m-4">No mira field loaded.</div>}
<Stack gap={4} className="rounded-md p-4 max-h-[60vh] overflow-y-auto">
{!fieldLoaded && (
<Alert severity="warning" className="m-2">
No mira field loaded.
</Alert>
)}
{editor && (
<Stack gap={6} className="md:flex-row items-start">
{/* Key List */}
Expand Down Expand Up @@ -325,7 +331,11 @@ const DeveloperToolPanel: React.FC<PanelImplProps<void, void>> = ({ panel }) =>
onChange={e => setJsonValue(e.target.value)}
placeholder="Enter JSON data for this key"
/>
{error && <div className="text-red-400 mt-1">{error}</div>}
{error && (
<Alert severity="error" className="mt-2">
{error}
</Alert>
)}
<div className="mt-3 flex gap-2">
<Button onClick={handleSave}>Save</Button>
<Button onClick={handleRemove}>Remove</Button>
Expand Down
Loading
Loading