Skip to content

Commit

Permalink
feature: new pending panel on create page (#154)
Browse files Browse the repository at this point in the history
* fix: issue with cached shortlinks

* feat: initial work on pending image panel for create page

* stash work

* feat: add quick and simple json file to update server status

* feat: add virtual list to pending panel
  • Loading branch information
daveschumaker authored Aug 18, 2023
1 parent 14509cb commit ffe3a24
Show file tree
Hide file tree
Showing 18 changed files with 665 additions and 29 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# 2023.08.17

- Fix issue with creating shareable links when swiping between images in the image modal.
- Feature: Experimenting with adding a new pending panel on the create page for wider displays (anything over 1100px wide). I may try to adjust that. Regardless, I'd like to start getting feedback. I think this layout makes it nice to get immediate feedback on images while you're still messing around with new image settings.

# 2023.08.16

- Increase max image dimensions to 3072 x 3072 for users with API key (there probably aren't many workers that can support that)
Expand All @@ -6,7 +11,7 @@

# 2023.08.15

- Add some logic that attempts to check for model mismatch between LORA and image modal and warn user if an incompatibility is found.
- Add some logic that attempts to check for model mismatch between LORA and image model and warn user if an incompatibility is found.
- Additional PR from tijszwinkels on GitHub that adds negative prompt to JPEG metadata (thank you!)
- Fix: Styling issues with inpainting toolbar

Expand Down
17 changes: 16 additions & 1 deletion app/(default-route-group)/create/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { basePath } from 'BASE_PATH'
import FlexRow from 'app/_components/FlexRow'
import PendingPanelView from 'app/_modules/PendingPanel/PendingPanelView'
import CreatePage from 'app/_pages/CreatePage'

async function getPageData() {
Expand Down Expand Up @@ -31,6 +33,19 @@ export default async function Page() {

// Forward fetched data to your Client Component
return (
<CreatePage availableModels={availableModels} modelDetails={modelDetails} />
<FlexRow
gap={8}
style={{
alignItems: 'flex-start',
justifyContent: 'flex-start',
position: 'relative'
}}
>
<CreatePage
availableModels={availableModels}
modelDetails={modelDetails}
/>
<PendingPanelView />
</FlexRow>
)
}
29 changes: 25 additions & 4 deletions app/_modules/AppUpdate/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
'use client'

import MaxWidth from 'app/_components/MaxWidth'
import ServerMessage from 'components/ServerMessage'
import ServerUpdateComponent from 'components/ServerUpdateComponent'
import { useCallback, useEffect, useState } from 'react'
import { useStore } from 'statery'
Expand All @@ -10,6 +12,8 @@ let waitingForServerInfoRes = false

export default function AppUpdate() {
const { buildId } = useStore(appInfoStore)
const [serverMsg, setServerMsg] = useState<any>(false)

const [showServerUpdateComponent, setShowServerUpdateComponent] =
useState(false)

Expand All @@ -26,7 +30,7 @@ export default function AppUpdate() {
waitingForServerInfoRes = true
const res = await fetch('/artbot/api/server-info')
const data = await res.json()
const { build } = data
const { build, serverMessage } = data

waitingForServerInfoRes = false

Expand All @@ -39,6 +43,12 @@ export default function AppUpdate() {
'Application was just updated in the background. Reload this page for the latest code.'
)
}

if (serverMessage) {
setServerMsg(serverMessage)
} else {
setServerMsg(false)
}
} catch (err) {
console.log(`Unable to fetch latest server-info. Connectivity issue?`)
waitingForServerInfoRes = false
Expand All @@ -54,7 +64,18 @@ export default function AppUpdate() {
return () => clearInterval(interval)
}, [fetchAppInfo])

if (showServerUpdateComponent) return <ServerUpdateComponent />

return null
return (
<>
{serverMsg && (
<MaxWidth>
<ServerMessage
title={serverMsg.title}
content={serverMsg.content}
timestamp={serverMsg.timestamp}
/>
</MaxWidth>
)}
{showServerUpdateComponent && <ServerUpdateComponent />}
</>
)
}
20 changes: 20 additions & 0 deletions app/_modules/PendingPanel/PendingPanelView.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
'use client'

/**
* Dynamic view to toggle whether or not the pending panel
* should be displayed on create page based on width
* of browser window.
*/

import { useWindowSize } from 'hooks/useWindowSize'
import PendingPanel from '.'

export default function PendingPanelView() {
const { width } = useWindowSize()

if (!width || width < 1100) {
return null
}

return <PendingPanel />
}
Loading

0 comments on commit ffe3a24

Please sign in to comment.