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

fix(ui): restore splitpanes sizes #6679

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
14 changes: 8 additions & 6 deletions packages/ui/client/pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,14 @@ const resizingMain = useDebounceFn((event: { size: number }[]) => {
function resizeMain() {
const width = window.innerWidth
const panelWidth = Math.min(width / 3, 300)
mainSizes.value[0] = (100 * panelWidth) / width
mainSizes.value[1] = 100 - mainSizes.value[0]
recordMainResize([
{ size: mainSizes.value[0] },
{ size: mainSizes.value[1] },
])
if (browserState) {
Copy link
Member

@sheremet-va sheremet-va Oct 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did it suddenly stop recording the main resize? recordMainResize affects how the browser displays panels

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We drop the middle panel in the default ui

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But we don't drop it in the browser

Copy link
Member Author

@userquin userquin Oct 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue is in the ui not in the browser ui

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you saying it is ok to break the browser UI?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I need to test the changes in the browser ui, this change just fix the ui.

This shouldn't break the browser ui, the logic is the same, we only initilize the ui panels properly.

The problem is about using the same storage key for both, the ui and the browser ui.

mainSizes.value[0] = (100 * panelWidth) / width
mainSizes.value[1] = 100 - mainSizes.value[0]
}
else {
detailSizes.value[0] = (100 * panelWidth) / width
detailSizes.value[1] = 100 - detailSizes.value[0]
}
}

function recordMainResize(event: { size: number }[]) {
Expand Down
Loading