Implement "floating windows" style UI (#224)

* Basic transparent pane styling

* HTML and static asset cleanup

* Convert to collapsibles

* Polish up DebugPanel

* Add hotkey support, remove allotment

* Remove allotment css dependency

* Merge in from main

* Add a different resizable package

* Fix tsc errors introduced by merge

* Stream has to have at least z-index of 0

* App header has to be above stream z-index

* Applied z-index to the wrong element

* Scrollable logs, disable UI while dragging

* Fix test errors from importing CSS Modules in Jest

* Persist open panes configuration

* Style tweaks and fix camera step in onboarding

* Kurt review, make click-drag handler declarative
This commit is contained in:
Frank Noirot
2023-08-06 21:29:26 -04:00
committed by GitHub
parent 4c5178ea5c
commit 391f4ba206
21 changed files with 619 additions and 258 deletions

View File

@ -108,6 +108,8 @@ interface DefaultDir {
dir: string
}
export type PaneType = 'code' | 'variables' | 'debug' | 'kclErrors' | 'logs'
// TODO: import real OpenAPI User type from schema
export interface User {
company?: string
@ -175,6 +177,12 @@ export interface StoreState {
setMediaStream: (mediaStream: MediaStream) => void
isStreamReady: boolean
setIsStreamReady: (isStreamReady: boolean) => void
isMouseDownInStream: boolean
setIsMouseDownInStream: (isMouseDownInStream: boolean) => void
cmdId?: string
setCmdId: (cmdId: string) => void
fileId: string
setFileId: (fileId: string) => void
// tauri specific app settings
defaultDir: DefaultDir
@ -191,6 +199,8 @@ export interface StoreState {
setOnboardingStatus: (status: string) => void
theme: 'light' | 'dark'
setTheme: (theme: 'light' | 'dark') => void
openPanes: PaneType[]
setOpenPanes: (panes: PaneType[]) => void
homeMenuItems: {
name: string
path: string
@ -352,6 +362,15 @@ export const useStore = create<StoreState>()(
setMediaStream: (mediaStream) => set({ mediaStream }),
isStreamReady: false,
setIsStreamReady: (isStreamReady) => set({ isStreamReady }),
isMouseDownInStream: false,
setIsMouseDownInStream: (isMouseDownInStream) => {
set({ isMouseDownInStream })
},
// For stream event handling
cmdId: undefined,
setCmdId: (cmdId) => set({ cmdId }),
fileId: '',
setFileId: (fileId) => set({ fileId }),
// tauri specific app settings
defaultDir: {
@ -374,6 +393,8 @@ export const useStore = create<StoreState>()(
? 'dark'
: 'light',
setTheme: (theme) => set({ theme }),
openPanes: ['code'],
setOpenPanes: (openPanes) => set({ openPanes }),
showHomeMenu: true,
setHomeShowMenu: (showHomeMenu) => set({ showHomeMenu }),
homeMenuItems: [],
@ -400,6 +421,7 @@ export const useStore = create<StoreState>()(
'debugPanel',
'onboardingStatus',
'theme',
'openPanes',
].includes(key)
)
),