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

Bugfix: Gridview whitespace autosize #10118

Merged
merged 28 commits into from
Dec 20, 2023

Conversation

lookacat
Copy link
Contributor

@lookacat lookacat commented Dec 5, 2023

Description

We've fixed a bug that caused the tiles-view to have whitespace
on the right side of the screen which is not optimal for efficiant
space management.
See #10040

Related Issue

Screenshots (if appropriate):

Looks bit weird cause of the screenrecording but looks smooth in realtime
chrome-capture-2023-11-5.webm

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:

Copy link

update-docs bot commented Dec 5, 2023

Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes.

@lookacat lookacat marked this pull request as ready for review December 5, 2023 13:25
Copy link
Contributor

@kulmann kulmann left a comment

Choose a reason for hiding this comment

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

Yeah, awesome!!! ❤️

@tbsbdr
Copy link

tbsbdr commented Dec 5, 2023

love it 🔥
I found 1 thing:
if you have only few items, these are streched over the whole width, ignoring the slider setting 😬

screenshot_002107
screenshot_002108

@tbsbdr tbsbdr self-requested a review December 5, 2023 16:12
tbsbdr
tbsbdr previously requested changes Dec 5, 2023
Copy link

@tbsbdr tbsbdr left a comment

Choose a reason for hiding this comment

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

please see #10118 (comment)

@lookacat lookacat force-pushed the bugfix-gridview-whitespace-autosize branch from 2232e28 to d0a2db0 Compare December 11, 2023 13:54
Copy link
Contributor

@kulmann kulmann left a comment

Choose a reason for hiding this comment

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

Having an empty folder and inserting items one by one feels very weird, since the tile size is shrinking with every new item. I would expect the tile size to be stable. Having only one non-filled line also looks wrong, since the gap sizes are quite huge. I'll attach a series of screenshots to visualize the issue.

I'd expect the tile size like in the last screenshots for all other screenshots as well. Maybe a solution with aria-hidden dummy items, like @janackermann proposed in a call earlier today, is working better. Could you give that a try?

Screenshot 2023-12-11 at 21 43 34 Screenshot 2023-12-11 at 21 43 49 Screenshot 2023-12-11 at 21 43 58 Screenshot 2023-12-11 at 21 44 07 Screenshot 2023-12-11 at 21 44 17 Screenshot 2023-12-11 at 21 44 26 Screenshot 2023-12-11 at 21 44 35 Screenshot 2023-12-11 at 21 44 43

packages/web-pkg/src/components/ViewOptions.vue Outdated Show resolved Hide resolved
@lookacat
Copy link
Contributor Author

@kulmann yes will try to do it that way

@lookacat lookacat force-pushed the bugfix-gridview-whitespace-autosize branch from 0832303 to fa91632 Compare December 12, 2023 13:10
@lookacat lookacat requested review from kulmann and tbsbdr December 12, 2023 13:10
@AlexAndBear AlexAndBear self-requested a review December 14, 2023 13:23
@lookacat lookacat force-pushed the bugfix-gridview-whitespace-autosize branch from 87c89f1 to 04ee2f0 Compare December 15, 2023 10:32
@AlexAndBear AlexAndBear self-requested a review December 16, 2023 11:44
@AlexAndBear AlexAndBear force-pushed the bugfix-gridview-whitespace-autosize branch from 04ee2f0 to a0bb25c Compare December 16, 2023 11:51
@AlexAndBear
Copy link
Contributor

@lookacat I cleaned up the code a little, I like the way where this is going and it looks already fine, but unfortantly the pr renders too much ghost tiles

image

@AlexAndBear AlexAndBear self-requested a review December 16, 2023 12:18
Copy link
Contributor

@AlexAndBear AlexAndBear left a comment

Choose a reason for hiding this comment

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

Check why too many ghost tiles are rendered

@AlexAndBear AlexAndBear force-pushed the bugfix-gridview-whitespace-autosize branch from b1f14ad to efce7c4 Compare December 16, 2023 12:29
@kulmann kulmann force-pushed the bugfix-gridview-whitespace-autosize branch from efce7c4 to ea26acb Compare December 18, 2023 09:33
@CLAassistant
Copy link

CLAassistant commented Dec 18, 2023

CLA assistant check
All committers have signed the CLA.

@kulmann kulmann changed the base branch from master to stable-8.0 December 18, 2023 09:33
@owncloud owncloud deleted a comment from AlexAndBear Dec 18, 2023
@lookacat lookacat requested a review from AlexAndBear December 19, 2023 11:06
@lookacat lookacat enabled auto-merge (squash) December 19, 2023 11:07
@kulmann kulmann dismissed stale reviews from tbsbdr and themself December 19, 2023 12:59

worked on the PR myself

Copy link
Contributor

@JammingBen JammingBen left a comment

Choose a reason for hiding this comment

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

LGTM overall. We should probably resolve my first remark, but IMO not a blocker since it works for now.

@@ -363,6 +385,50 @@ export default defineComponent({
context.emit('fileDropped', resource.id)
}

const viewWidth = ref<number>(0)
const updateViewWidth = () => {
const element = document.getElementById('tiles-view')
Copy link
Contributor

Choose a reason for hiding this comment

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

Feels quite weird to set the id tiles-view from the outside and then reference it here because it creates an indirect dependency. I think it would be cleaner to set the id here in the component, or better use a template ref.

packages/web-pkg/src/composables/viewMode/useTileSize.ts Outdated Show resolved Hide resolved
@lookacat lookacat requested a review from AlexAndBear December 20, 2023 09:35
Copy link

@lookacat lookacat merged commit 16bb36a into stable-8.0 Dec 20, 2023
3 checks passed
@delete-merged-branch delete-merged-branch bot deleted the bugfix-gridview-whitespace-autosize branch December 20, 2023 13:52
ownclouders pushed a commit that referenced this pull request Dec 20, 2023
* Bugfix: Gridview whitespace autosize

* Fix large scale

* Fix viewoption sizes

* Add changelog

* Update unittests

* WIP

* Solution?

* WIP

* WIP

* Remove dev leftover

* cleanup code

* Calculate max tiles count per row / still needs to be recalculated when the slider value changes

* Implement watch for tile-size slider changes

* Rename rowCount

* Lint, change var to const, remove unnecessary computed

* Hide from screen readers

* feat: introduce useTileSize composable and watch that for tile sizes

* Fix undefined issues

* slim mount function

* fix: tile pixels and ghost tile count

* test: fix viewOptions unit tests

* Fixing ResourceTiles.spec.ts tests (WIP)

* Fix ResourceTiles.spec.ts

* Remove dev leftover

---------

Co-authored-by: Jan Ackermann <jan.alexander.ackermann@outlook.com>
Co-authored-by: Benedikt Kulmann <benedikt@kulmann.biz>
@JammingBen JammingBen mentioned this pull request Dec 20, 2023
JammingBen pushed a commit that referenced this pull request Dec 22, 2023
* Bugfix: Gridview whitespace autosize

* Fix large scale

* Fix viewoption sizes

* Add changelog

* Update unittests

* WIP

* Solution?

* WIP

* WIP

* Remove dev leftover

* cleanup code

* Calculate max tiles count per row / still needs to be recalculated when the slider value changes

* Implement watch for tile-size slider changes

* Rename rowCount

* Lint, change var to const, remove unnecessary computed

* Hide from screen readers

* feat: introduce useTileSize composable and watch that for tile sizes

* Fix undefined issues

* slim mount function

* fix: tile pixels and ghost tile count

* test: fix viewOptions unit tests

* Fixing ResourceTiles.spec.ts tests (WIP)

* Fix ResourceTiles.spec.ts

* Remove dev leftover

---------

Co-authored-by: Jan Ackermann <jan.alexander.ackermann@outlook.com>
Co-authored-by: Benedikt Kulmann <benedikt@kulmann.biz>
@micbar micbar mentioned this pull request Dec 27, 2023
71 tasks
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.

Optimize tiles view
6 participants