Skip to content

Commit

Permalink
feat(client): show split screen feature always (#96)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexzhang1030 authored Dec 21, 2023
1 parent aa071d3 commit 2edba99
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 8 deletions.
3 changes: 1 addition & 2 deletions packages/client/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ watchEffect(() => {
})
const splitScreenEnabled = computed(() => clientState.value.splitScreen.enabled)
const isSplitScreenAvailable = splitScreenAvailable
const splitScreenSize = computed({
get: () => clientState.value.splitScreen.size,
set: v => clientState.value.splitScreen.size = v,
Expand Down Expand Up @@ -86,7 +85,7 @@ watchEffect(() => {
<Pane h-full class="of-auto!" min-size="10" :size="splitScreenSize[0]">
<RouterView />
</Pane>
<Pane v-if="!isUtilityView && splitScreenEnabled && isSplitScreenAvailable" relative h-full class="of-auto!" :size="splitScreenSize[1]">
<Pane v-if="!isUtilityView && splitScreenEnabled" relative h-full class="of-auto!" :size="splitScreenSize[1]">
<SplitScreen />
</Pane>
</Splitpanes>
Expand Down
3 changes: 1 addition & 2 deletions packages/client/src/components/common/DockingPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ const splitScreenEnabled = computed({
get: () => devtoolsClientState.value.splitScreen.enabled,
set: v => (devtoolsClientState.value.splitScreen.enabled = v),
})
const isSplitScreenAvailable = splitScreenAvailable
function refreshPage() {
location.reload()
Expand Down Expand Up @@ -65,7 +64,7 @@ watch(activeAppRecordId, (id) => {
<div i-carbon-settings-adjust /> Settings
</VueButton>
</div>
<div v-if="isSplitScreenAvailable" px3 py2 border="b base" flex="~ gap-2">
<div px3 py2 border="b base" flex="~ gap-2">
<VueButton outlined type="primary" @click="splitScreenEnabled = !splitScreenEnabled">
<div i-carbon-split-screen />
{{ splitScreenEnabled ? 'Close Split Screen' : 'Split Screen' }}
Expand Down
4 changes: 0 additions & 4 deletions packages/client/src/composables/state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,6 @@ export function resetDevtoolsClientState() {
}

// #region split screen related
const windowSize = useWindowSize()

export const splitScreenAvailable = computed(() => windowSize.width.value > 1080)

watch(() => devtoolsClientState.value.splitScreen.enabled, (enabled, o) => {
if (o && !enabled) {
// reset size
Expand Down

0 comments on commit 2edba99

Please sign in to comment.