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

Desktop: Resolves #10151: make editor always have dynamic size #10298

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

G0maa
Copy link

@G0maa G0maa commented Apr 11, 2024

This resolves #10151.

By default all layoutItems have a resizeableRight set as true if not last child.

This solution adds a resizeableLeft option in LayoutItem type.
And sets if as true if the editor is before that element.

This change should be apparent only if there are elements after editor.

Copy link
Contributor

github-actions bot commented Apr 11, 2024

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@G0maa
Copy link
Author

G0maa commented Apr 11, 2024

I have read the CLA Document and I hereby sign the CLA

@G0maa
Copy link
Author

G0maa commented Apr 11, 2024

recheck

github-actions bot added a commit that referenced this pull request Apr 11, 2024
@laurent22
Copy link
Owner

Could you provide a video showing how it work please? Basically when the editor is not in the last column, and you resize the whole window, only the editor should be resized. All other columns should keep their own size. I'm not sure if that's what the code does, but maybe it is.

Also we'll need some tests for it but first please provide a video.

@G0maa
Copy link
Author

G0maa commented Apr 14, 2024

Hello Laurent,

I've just made it so you're resizing the noteList element not editor element. (or any element that comes after the editor directly)

P.S. you can see at 0:24 the Outline element is dynamic too, this happens only when the layout is reset. When you resize Outline element, it works as expected.

Video as requested:

2024-04-14.08-58-36.mp4

@laurent22
Copy link
Owner

Thank you, that indeed looks good. Would you mind adding tests for it? Perhaps in useLayoutItemSizes.test.ts, and one for validateLayout.ts too since this is what you're modifying.

P.S. you can see at 0:24 the Outline element is dynamic too, this happens only when the layout is reset. When you resize Outline element, it works as expected.

Is there any way to fix this? It seems it starts working once you resize one of the panel, so maybe it means the "width" property needs to be set right away? Or maybe some rule that auto-size panels when the width is undefined needs to be removed?

@laurent22
Copy link
Owner

Any update?

@G0maa
Copy link
Author

G0maa commented Apr 17, 2024

Hello, Sorry for being late.

I haven't started working on writing the tests yet. I'll do them in the weekend probably.

@G0maa
Copy link
Author

G0maa commented Apr 18, 2024

I've added two simple tests, I'm unsure if they're enough or not. It's implied that if an element has neither resizeableRight nor resizeableLeft then it can't have width (like editor).

Is there any way to fix this? It seems it starts working once you resize one of the panel, so maybe it means the "width" property needs to be set right away? Or maybe some rule that auto-size panels when the width is undefined needs to be removed?

I can look into this, but I'm not sure if it's a good idea, as every new added element will have e.g. minimum width.

@G0maa
Copy link
Author

G0maa commented Apr 24, 2024

I noticed other bugs... it's kind of amusing. This solution probably needs more work since the only way for it to work is if you pretty much resize all panes after resetting layout (not practical).

Awaiting your tips.

2024-04-24.18-14-04.mp4

Edit: this one was already existent before my change.

@G0maa
Copy link
Author

G0maa commented May 7, 2024

Hello?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Give the panel that contains the editor a dynamic width
2 participants