Skip to content
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
3 changes: 1 addition & 2 deletions src/mainPage/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ function renderEnvSignature (env?: RenderEnvironment): string {
env.layout,
env.theme,
env.inputMode,
env.viewport?.width,
env.viewport?.height
env.viewport?.width
].join('|')
}

Expand Down
14 changes: 14 additions & 0 deletions test/unit/mainPage/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,20 @@ describe('browser navigation without a reload', () => {
expect(GotoSubject).toHaveBeenCalledOnce()
})

it('does not re-render when only the viewport height changes', async () => {
const GotoSubject = await setupLoaded()
const outliner = getOutliner()
outliner.__lastRenderEnvSignature = 'desktop|light|pointer|1280'
outliner.context = {
session: { store },
environment: { ...environment, viewport: { width: 1280, height: 620 } }
}

await refreshUI(outliner)

expect(GotoSubject).not.toHaveBeenCalled()
})

it('refreshes explorers instead of replacing the page during an active edit', async () => {
const GotoSubject = await setupLoaded()
const main = document.createElement('main')
Expand Down
Loading