Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Font scaling settings and slider #4424

Merged

Conversation

JorikSchellekens
Copy link
Contributor

@JorikSchellekens JorikSchellekens commented Apr 16, 2020

Requires element-hq/element-web#13199
Requires element-hq/element-web#13352
Fixes element-hq/element-web#3160

Test it out: https://riots.im/adhoc/resize-mania4/
This implements two related things:

  1. It migrates the theme settings to a style tab
  2. It implements a font control system in the style tab which is hidden behind labs

image

Font size 18
image

Font size 14
image

Copy link
Member

@turt2live turt2live left a comment

Choose a reason for hiding this comment

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

Overall the actual change looks good, just some comments on the project structure.

res/css/structures/_TagPanel.scss Outdated Show resolved Hide resolved
src/components/structures/FontSlider.js Outdated Show resolved Hide resolved
src/components/structures/FontSlider.js Outdated Show resolved Hide resolved
src/components/structures/FontSlider.js Outdated Show resolved Hide resolved
src/components/structures/FontSlider.js Outdated Show resolved Hide resolved
src/settings/Settings.js Outdated Show resolved Hide resolved
src/theme.js Outdated Show resolved Hide resolved
@JorikSchellekens JorikSchellekens force-pushed the joriks/font-scaling-slider branch 2 times, most recently from 075b47f to dc57590 Compare April 22, 2020 09:24
@nadonomy
Copy link
Contributor

nadonomy commented Apr 22, 2020

Hey @JorikSchellekens, on:

  1. Use only one of the input methods
  2. Use both methods but have only one available at a time according to a toggle
  3. Use both methods which mutually update each other as displayed in the screenshots

Let's stick to the designs, as per (2), where:

  • The stepper isn't labelled with numbers
  • There's a toggle to enable custom input
  • When custom input is enabled, the stepper enters a disabled state

This was a hard pill to swallow
This fix isn't perfect. Currently the scroll view is
slightly smaller than the list of rooms. I think it has something
to do with the how the heigh is calculate in js, considering it has
some assumptions about the height of each bar and the padding. However
room items are the only things which change with respect to the root
value. Therefore the item list is actually taller than the computed
pixel value of the list converted to rems.

I'll look into it.
@JorikSchellekens JorikSchellekens mentioned this pull request Apr 30, 2020
Copy link
Member

@turt2live turt2live left a comment

Choose a reason for hiding this comment

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

largely seems fine from a code perspective - just picking out the style/lint things at this point.

Comment on lines 266 to 267
$Slider-selection-color: $accent-color;
$Slider-background-color: #c1c9d6;
Copy link
Member

Choose a reason for hiding this comment

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

we generally prefer all-lowercase variables

Copy link
Contributor Author

@JorikSchellekens JorikSchellekens May 6, 2020

Choose a reason for hiding this comment

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

Ah, just spotted these change requests. Would it be worth adding this to the linter?

Copy link
Member

Choose a reason for hiding this comment

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

yes. We should add a lot of stuff to the linter :D

src/FontWatcher.js Outdated Show resolved Hide resolved
src/FontWatcher.js Outdated Show resolved Hide resolved
src/components/views/elements/Slider.tsx Outdated Show resolved Hide resolved
src/settings/Settings.js Outdated Show resolved Hide resolved
@nadonomy
Copy link
Contributor

nadonomy commented May 6, 2020

  • Test if first clicks on the slider are more performant without animations
  • R&D letting browsers know text sizes could change in advance to avoid poor performance on first clicks (worth pairing on with Bruno)
  • Nad & Rok to look again at interactions between slider & custom— switching between the 2 feels strange, clicking on the slider steps is hard, font size values are abstract (consider using 100% as default and letting users input relative to that), solve slider not scaling
  • Nad to get better clarity on values (up to 20px is safe)
  • Nad to dogfood + make a list of obviously broken stuff

@JorikSchellekens
Copy link
Contributor Author

Thanks @turt2live for the lints. They should all be cleaned up now. Wondering if we can add lowercase css variables to the linter

@JorikSchellekens JorikSchellekens requested a review from turt2live May 7, 2020 12:22
@turt2live
Copy link
Member

@JorikSchellekens this has conflicts and doesn't look like the last review was actually resolved? (no pushed commits)

@JorikSchellekens
Copy link
Contributor Author

Woops sorry @turt2live , pushed them now

@JorikSchellekens
Copy link
Contributor Author

JorikSchellekens commented May 13, 2020

Definitely seems like a smoother experience without the animations. The screen jump as a result of font size change isn't overly disturbing

@JorikSchellekens
Copy link
Contributor Author

I'm not getting poor performance, and without the animations I think it's no longer a problem.

- also fiddles the font size numbers
Copy link
Member

@turt2live turt2live left a comment

Choose a reason for hiding this comment

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

Otherwise lgtm - thanks!

Apologies for the delays on these reviews :(

src/settings/Settings.js Outdated Show resolved Hide resolved
src/settings/Settings.js Outdated Show resolved Hide resolved
@JorikSchellekens
Copy link
Contributor Author

We decided to have the slider reactivate itself if it was disabled and it was clicked on. However, with the way the settingtoggle currently works that's a little awkward to do. I'll have a look at clean way of doing this when experimenting with checkboxes under the new appearance tab.

Copy link
Member

@turt2live turt2live left a comment

Choose a reason for hiding this comment

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

otherwise lgtm, assuming the tests can be made to pass

src/FontWatcher.js Outdated Show resolved Hide resolved
@JorikSchellekens JorikSchellekens merged commit d95d019 into matrix-org:develop May 20, 2020
@8go

This comment has been minimized.

@jryans

This comment has been minimized.

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

Successfully merging this pull request may close these issues.

make it possible to change font size
5 participants