perf: reduce streaming render cost and refresh activity page on demand
- Segment streaming Markdown so completed blocks are reused and only the growing tail is re-parsed; fall back to whole-document parsing for document-wide constructs - Memoize conversation sidebar rows and cache per-conversation derived activity, ordering and pending approvals - Activity page loads on entry, refreshes every 15 s while visible, and has a single header refresh button - Include pending settings, model download source, device sharing and knowledge gateway changes in the working tree - Add Electron streaming input benchmark and regression tests
This commit is contained in:
@@ -9,12 +9,13 @@ import '../../src/renderer/src/styles.css'
|
||||
const settings = applicationSettingsSchema.parse({ checkUpdatesOnStartup: false, updateSource: 'github', modelDownloadSource: 'modelscope',
|
||||
localToolEnvironment: defaultLocalToolEnvironmentSettings, conversationHtmlRenderingEnabled: true, remoteProjectsEnabled: false })
|
||||
function Harness(): React.JSX.Element {
|
||||
const [currentSettings, setSettings] = useState(settings)
|
||||
const [open, setOpen] = useState(true)
|
||||
const [page, setPage] = useState(false)
|
||||
return <UiLocaleProvider initialPreference="en-US">
|
||||
{open && <ApplicationCenter settings={settings} pending={false} onClose={() => setOpen(false)}
|
||||
{open && <ApplicationCenter settings={currentSettings} pending={false} onClose={() => setOpen(false)}
|
||||
onOpen={id => { if (id === 'device-sharing') { setPage(true); setOpen(false) } }}
|
||||
onUpdate={async () => false} onRetry={() => undefined} />}
|
||||
onUpdate={async patch => { setSettings(current => ({ ...current, ...patch })); return true }} onRetry={() => undefined} />}
|
||||
{page && <DeviceSharingPage notify={input => { document.documentElement.dataset.notification = input.message }} />}
|
||||
</UiLocaleProvider>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user