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

List view top padding #178626

Closed
rebornix opened this issue Mar 29, 2023 · 3 comments
Closed

List view top padding #178626

rebornix opened this issue Mar 29, 2023 · 3 comments
Assignees
Labels
debt Code quality issues
Milestone

Comments

@rebornix
Copy link
Member

In notebook, we allow users to insert cells at the top of the document through a toolbar (+ Code, + Markdown)

image

The toolbar is part of a list item, so to support it we need some padding at the top of the list view. However, we didn't put the top padding on the outer container of the list widget because when the user scrolls the list view, we want the toolbar to move out of view.

image

Our current approach is very "hacky", we put a top padding on the scrollable element div of the list view. The catch with this approach is that when users navigate in the list view, the list item doesn't always fully reveal itself (it's off by ${top_padding}px).

Proposal

Ideally, we would like to implement a setting similar to Monaco Editor's editor.padding.top in the list view. Monaco editor allows us to customize both the top and bottom padding (editor.padding.top, editor.padding.bottom), currently we can already customize the bottom padding by changing listOptions.additonalScrollHeight but there isn't a way to customize the top.

@rebornix
Copy link
Member Author

rebornix commented Mar 29, 2023

@joaomoreno I built a prototype of adding the topPadding concept to the RangeMap in #178627 which archives what's described above. I'm not happy with how we update it https://github.com/microsoft/vscode/pull/178627/files#diff-3d4ece577e675a1d9b84484897bc7f64624f7a6d0ea9c4ce715713afcbf9032fR473-R487 but you can get an idea of what I'm asking for.

@rebornix rebornix added this to the June 2023 milestone Jun 5, 2023
@rebornix rebornix added the debt Code quality issues label Jun 5, 2023
@joaomoreno joaomoreno removed their assignment Jun 23, 2023
@rebornix rebornix modified the milestones: June 2023, July 2023 Jun 26, 2023
@rebornix
Copy link
Member Author

Fixed via #178627

@rebornix
Copy link
Member Author

We now can set list view's top padding directly instead of our hack of CSS. This means we can programmatically update the padding based on the height of sticky scroll. cc @Yoyokrazy

@github-actions github-actions bot locked and limited conversation to collaborators Aug 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
debt Code quality issues
Projects
None yet
Development

No branches or pull requests

2 participants