Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More UX improvements #116

Merged
merged 4 commits into from
Jan 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions backend/app/tasks/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,5 @@ class WorkerSettings:
redis_settings = REDIS_SETTINGS
keep_result = 3600 # Keep results for 1 hour
max_jobs = 10
job_timeout = 7200
allow_abort_jobs = True
2 changes: 1 addition & 1 deletion frontend/src/scenes/frame/panels/SceneState/SceneState.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export function SceneState(): JSX.Element {
return (
<Form logic={frameLogic} props={{ frameId }} formKey="frameForm">
<Group name={['scenes', sceneIndex]}>
<div className="flex justify-between w-full items-center gap-2 mb-2 mt-4">
<div className="flex justify-between w-full items-center gap-2 mb-2">
<H6>
State fields{' '}
<div className="inline-block align-text-top">
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/scenes/frame/panels/Templates/Templates.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -275,5 +275,5 @@ export function Templates() {
}

Templates.PanelTitle = function TemplatesPanelTitle() {
return <>Scenes to install</>
return <>Available scenes</>
}
29 changes: 15 additions & 14 deletions frontend/src/scenes/frame/panels/panelsLogic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,20 @@ export interface AnyBuiltLogic extends BuiltLogic {}
const DEFAULT_LAYOUT: Record<Area, PanelWithMetadata[]> = {
[Area.TopLeft]: [{ panel: Panel.Scenes, active: false, hidden: false }],
[Area.TopRight]: [
{ panel: Panel.Templates, active: false, hidden: false },
{ panel: Panel.Apps, active: true, hidden: false },
{ panel: Panel.SceneState, active: true, hidden: false },
{ panel: Panel.Apps, active: false, hidden: false },
{ panel: Panel.Events, active: false, hidden: false },
{ panel: Panel.SceneState, active: false, hidden: false },
{ panel: Panel.FrameSettings, active: false, hidden: false },
{ panel: Panel.Templates, active: false, hidden: false },
],
[Area.BottomLeft]: [
{ panel: Panel.Logs, active: true, hidden: false },
{ panel: Panel.FrameDetails, active: false, hidden: false },
{ panel: Panel.FrameSettings, active: false, hidden: false },
{ panel: Panel.Metrics, active: false, hidden: false },
{ panel: Panel.Terminal, active: false, hidden: false },
{ panel: Panel.Debug, active: false, hidden: false },
{ panel: Panel.SceneSource, active: false, hidden: false },
{ panel: Panel.Assets, active: false, hidden: false },
{ panel: Panel.SceneSource, active: false, hidden: false },
],
[Area.BottomRight]: [{ panel: Panel.Image, active: true, hidden: false }],
}
Expand Down Expand Up @@ -198,25 +198,26 @@ export const panelsLogic = kea<panelsLogicType>([
}),
selectors(() => ({
id: [() => [(_, props) => props.id], (id) => id],
diagramOpen: [
scenesOpen: [
(s) => [s.panels, s.fullScreenPanel],
(panels, fullScreenPanel): boolean =>
fullScreenPanel?.panel === Panel.Diagram ||
!!panels[Area.TopLeft].find(
(p) => p.panel === Panel.Diagram && (p.active || panels[Area.TopLeft].length === 1)
),
fullScreenPanel?.panel === Panel.Scenes ||
panels[Area.TopLeft].filter((p) => p.active).length === 0 ||
!!panels[Area.TopLeft].find((p) => p.panel === Panel.Scenes && p.active),
],
panelsWithConditions: [
(s) => [s.panels, s.fullScreenPanel, s.diagramOpen],
(panels, fullScreenPanel, diagramOpen): Record<Area, PanelWithMetadata[]> => {
(s) => [s.panels, s.fullScreenPanel, s.scenesOpen],
(panels, fullScreenPanel, scenesOpen): Record<Area, PanelWithMetadata[]> => {
if (!fullScreenPanel) {
return {
...panels,
[Area.TopRight]: panels[Area.TopRight].filter((p) =>
diagramOpen ? true : p.panel !== Panel.Apps && p.panel !== Panel.Events && p.panel !== Panel.SceneState
scenesOpen
? [Panel.Templates].includes(p.panel)
: [Panel.Apps, Panel.Events, Panel.SceneState].includes(p.panel)
),
[Area.BottomLeft]: panels[Area.BottomLeft].filter((p) =>
diagramOpen ? true : p.panel !== Panel.SceneSource
!scenesOpen ? true : p.panel !== Panel.SceneSource
),
}
}
Expand Down
Loading