Commit Graph

33 Commits

Author SHA1 Message Date
absidue 88bed9eaf6
Fix handling of emojis with ZWJ sequences in profile initials (#5023) 2024-04-27 10:53:03 +08:00
Jason 23f1618fcb
Add back 3 Stylelint configs (#4350)
* Add back @double-great/stylelint-a11y Stylelint plugin

Notably, we choose to not use the 'a11y/no-outline-none' rule. The reason for this being that our focus ring suffices for almost every use case (https://www.w3.org/WAI/WCAG22/Understanding/focus-appearance-minimum), and using the same hover and focus styling can be considered bad design in many cases. YT goes the direction of foregoing the focus ring for many of its components and choosing a barely darker color than its :hover for :focus styling, which is controversial. Accessibility-wise, at the very least, using the same hover and focus styling can be confusing, especially for sighted users who use keyboard navigation.

* Add back stylelint-config-sass-guidelines

* Add back stylelint-config-standard

* Satisfy media-prefers-reduced-motion a11y rule

This is not recognized as a fix by the rule due to its limited detection logic, so this rule is not being imported directly.

* Remove duplicate code

* Implement linting fixes

* Implement _ft-list-item.scss linting fixes excluding no-descending-specificity

Properly implementing the no-descending-specificity rule in this file seems to utterly destroy the styling. This would be its own entire initiative to unravel.

* Restart from scratch modifications of _ft-list-item.scss

* Resolve styling discrepancies introduced with ft-list-channel and ft-tooltip
2024-04-17 19:49:37 +02:00
absidue 32080cc8e3
Hide ft-icon-button and ft-profile-selector dropdowns when the escape key is pressed (#4770) 2024-03-18 08:30:02 -04:00
Jason 47946ff453
Profile settings UX improvements (#4358)
* Update Edit Profile styling, labels, and order

* Introduce additional styling updates

* Remove check for channel name of All Channels, as that can be faulty for users who renamed it & had another profile take the name

* Force use of All Channels profile translation (& forbid alteration of All Channels profile name

* Combine ProfileSettings and ProfileEdit routes under one route

* Implement active settings profile styling & profileList watcher

* Fix pre-existing bug of selected channels & count in Other Channels not updating when changing the profile filter

* Fix pre-existing behavior of filter profile selection resetting after each use

* Fix pre-existing bug with Edit Profile Subscription List of count bugging after adding new channel mid-count

And vice versa with removing channel mid-count on Other Channels.

* Fix two toasts to use localized profile name, & remove unnecessary mounted

* Remove old modification of base ft-input styling
2023-11-25 18:23:27 +01:00
Jason e68c534e6c
A new way to subscribe (#4238)
* Implement styling for new subscribe button

* Implement dropdown element and styling

* Implements remaining styling and logic

* Correct use of aria-selected in FT

Note: was able to add aria-controls to ft-profile-selector because it keeps the hidden dropdown in the DOM. The same is not true of the ft-icon-button or ft-subscribe-button. Main point: aria-expanded should go on the button opening the dropdown, not the dropdown itself.

* Resolve subscribe button staying upon bug

* Remove unneeded vendor-specific transition prefixes

See discussion here: https://www.web-plus-plus.com/Articles/css-transition-moz-and-webkit-vs-css3
2023-11-22 17:19:11 +00:00
CelularBat 62e7b439db
Display more profiles on the profile drop-down list, v2 (fixed for low res, fixed linter) (#4359)
* Update ft-profile-selector.css

Fixed for low res, fixed linter complains

* Update comment to max-block-size

* comment to max-block-size

fixed typo

* Update ft-profile-selector.css

adjust for screen with horizontal navbar (mobile)

* Update src/renderer/components/ft-profile-selector/ft-profile-selector.css

Co-authored-by: PikachuEXE <pikachuexe@gmail.com>

* Update src/renderer/components/ft-profile-selector/ft-profile-selector.css

Co-authored-by: PikachuEXE <pikachuexe@gmail.com>

* Update src/renderer/components/ft-profile-selector/ft-profile-selector.css

Co-authored-by: PikachuEXE <pikachuexe@gmail.com>

---------

Co-authored-by: PikachuEXE <pikachuexe@gmail.com>
2023-11-22 11:14:54 -05:00
Jason 3db6f437c9
Implement Stylelint linting of CSS logical properties (#4023)
* Add Stylelint plugin and rule for evaluating use of logical properties

* Implement stylelint-advised use of logical properties in SCSS files

* Implement stylelint-advised use of logical properties in CSS files

* Implement stylelint linting before each commit to any branch of the repo

* Remove other Stylelint plugins so that we can add them in later one-by-one

After discussing this with the FreeTube team, it seems that we are still undecided on which rules we want to be active, including ones currently enabled. As a stopgap fix, we disabled Stylelint checking in our pre-commit Git hook and our recommended
> freetube@0.19.0 lint-fix
> run-p eslint-fix lint-style-fix command. With this change, we will be using Stylelint in our
> freetube@0.19.0 lint-fix
> run-p eslint-fix lint-style-fix command, while giving us the flexibility to add in additional desired plugins and rules as separate efforts.

* Add video player to .stylelintignore

* Replace non-logical property usage in templates

This is not enforced by the plugin at this time.

* Remove use of logical properties from ft-video-player, & allow empty input when .stylelintignore files are changed

* Update ft-video-player.css to disable use of logical property linter

We want to avoid introducing directionality-specific properties that could muck up the video player.

* Remove redundant/unnecessary scripts in package.json
2023-09-14 08:22:33 +08:00
Jason 6f2a535212
Implement right-to-left interface (#3970)
* Replace margin-left with margin-inline-start

* Replace margin-right with margin-inline-end

* Replace padding-left with padding-inline-start

* Replace padding-right with padding-inline-end

* Replace padding-top & padding-bottom with padding-block; continue replacing  padding-left and padding-right with padding-inline-start and padding-inline-end

* Add updated rtl-compatible margins to ft-slider and fix indentation

* Replace margin-top & margin-bottom with margin-block; continue replacing margin-left and margin-right with margin-inline-start and margin-inline-end

* Continue replacing with margin-block and margin-inline

* Replace left and right with inset-inline-start and inset-inline-end

This commit also changes border-left to border-inline-start, and border-right to border-inline-end.

* Replace margin-bottom, top, and bottom with margin-block-end, inset-block-start, and inset-block-end

This commit also replaces border-top and border-bottom with border-block-start and border-block-end.

* Replace text-align left and right with text-align start and end

* Fix syntax error with inset-block-end

* Implement dynamic float: left/right based on direction ltr/rtl

* Implement dynamic navigation arrow placement based on direction ltr/rtl

To the fullest of my understanding, it is expected for the left navigation in rtl-supporting browsers to be for forward navigation, and the right one to be for backward navigation.

* Add direction to body based on preferred language

* Implement horizontal directionality coefficient to fix translate working in wrong x-direction for rtl languages

* Add explicit text-align: start in places to ensure rtl version is correctly aligned

* Add text-align: start to places where it is not inferred to enable proper rtl text orientation

* Fix search bar magnifying glass being too far right issue

* Move body.dir-setting logic to setLocale to fix dir not setting correctly on page reload

* Change .switchColumn to have align-items: start instead of justify-items: start

I have validated this for all settings tabs; the justify-content: start did nothing in any language, left-to-right or right-to-left. Replacing it with align-items: start aligned all menu switch items by their switches, not by their labels. This makes for a much more uniform settings section for trl languages.

* Fix emergent bug in which history icons are temporarily disabled on changing language to one with different directionality

Given that which icon is displayed for which history arrow is now dynamic based on the user's directionality, changing of the icon resets the font-awesome-icon state and thus re-adds the base disabled class to both arrows. This means that changing your language to one that has a different directionality was falsely setting the arrows to their disabled state (until the route is changed, after which the history icons will be fully back to normal). This commmit refactors the history icon setting logic to use class binding to two booleans in the top-nav component's data rather than adding and removing the disabled classes directly to the arrow elements' classLists, thus cleaning up the implementation and fixing the bug.

* Add Kurdish to rtl languages list & add li items to be right-aligned on rtl languages

* Force FreeTube logo to be ordered left-to-right for 'brand consistency'

* Add styling flipping font-awesome icons for rtl languages except for exclusion list

* Update isRightAligned with additional languages, and use it instead of locale value from store

Kudos to absidue for pointing out this existing function for representing this, and that it grabs directly from the i18n object. This means that FreeTube will display the proper rtl interface if one is the user's system language, where it did not before.

* Update isRightAligned property name to more clearly reflect rtl purpose

* Simplify left/right arrow display logic

Leverage the icons being flipped rather than manually setting the classes to their opposites when the directionality is RTL.

* Replace justify-self: left & justify-self: right with justify-self; start and justify-self: end

* Remove misguided attempt to emulate directionality-agnosticism with rightAligned class

* Explicitly center FreeTube version on About page

* Replace pre-existing identation issue

* Replace margin-left with margin-inline-start

* Replace margin-right with margin-inline-end

* Replace padding-left with padding-inline-start

* Replace padding-right with padding-inline-end

* Replace padding-top & padding-bottom with padding-block; continue replacing  padding-left and padding-right with padding-inline-start and padding-inline-end

* Add updated rtl-compatible margins to ft-slider and fix indentation

* Replace margin-top & margin-bottom with margin-block; continue replacing margin-left and margin-right with margin-inline-start and margin-inline-end

* Continue replacing with margin-block and margin-inline

* Replace left and right with inset-inline-start and inset-inline-end

This commit also changes border-left to border-inline-start, and border-right to border-inline-end.

* Replace margin-bottom, top, and bottom with margin-block-end, inset-block-start, and inset-block-end

This commit also replaces border-top and border-bottom with border-block-start and border-block-end.

* Replace text-align left and right with text-align start and end

* Fix syntax error with inset-block-end

* Implement dynamic float: left/right based on direction ltr/rtl

* Implement dynamic navigation arrow placement based on direction ltr/rtl

To the fullest of my understanding, it is expected for the left navigation in rtl-supporting browsers to be for forward navigation, and the right one to be for backward navigation.

* Add direction to body based on preferred language

* Implement horizontal directionality coefficient to fix translate working in wrong x-direction for rtl languages

* Add explicit text-align: start in places to ensure rtl version is correctly aligned

* Add text-align: start to places where it is not inferred to enable proper rtl text orientation

* Fix search bar magnifying glass being too far right issue

* Move body.dir-setting logic to setLocale to fix dir not setting correctly on page reload

* Change .switchColumn to have align-items: start instead of justify-items: start

I have validated this for all settings tabs; the justify-content: start did nothing in any language, left-to-right or right-to-left. Replacing it with align-items: start aligned all menu switch items by their switches, not by their labels. This makes for a much more uniform settings section for trl languages.

* Fix emergent bug in which history icons are temporarily disabled on changing language to one with different directionality

Given that which icon is displayed for which history arrow is now dynamic based on the user's directionality, changing of the icon resets the font-awesome-icon state and thus re-adds the base disabled class to both arrows. This means that changing your language to one that has a different directionality was falsely setting the arrows to their disabled state (until the route is changed, after which the history icons will be fully back to normal). This commmit refactors the history icon setting logic to use class binding to two booleans in the top-nav component's data rather than adding and removing the disabled classes directly to the arrow elements' classLists, thus cleaning up the implementation and fixing the bug.

* Add Kurdish to rtl languages list & add li items to be right-aligned on rtl languages

* Force FreeTube logo to be ordered left-to-right for 'brand consistency'

* Add styling flipping font-awesome icons for rtl languages except for exclusion list

* Update isRightAligned with additional languages, and use it instead of locale value from store

Kudos to absidue for pointing out this existing function for representing this, and that it grabs directly from the i18n object. This means that FreeTube will display the proper rtl interface if one is the user's system language, where it did not before.

* Update isRightAligned property name to more clearly reflect rtl purpose

* Simplify left/right arrow display logic

Leverage the icons being flipped rather than manually setting the classes to their opposites when the directionality is RTL.

* Replace justify-self: left & justify-self: right with justify-self; start and justify-self: end

* Remove misguided attempt to emulate directionality-agnosticism with rightAligned class

* Explicitly center FreeTube version on About page

* Fix question mark reversing logic for Arabic, Hebrew, Persian, and Urdu

* Fix minor indentation issue

Co-authored-by: absidue <48293849+absidue@users.noreply.github.com>

* Remove unused function

Co-authored-by: absidue <48293849+absidue@users.noreply.github.com>

* Update src/renderer/components/ft-slider/ft-slider.css

Co-authored-by: PikachuEXE <pikachuexe@gmail.com>

---------

Co-authored-by: absidue <48293849+absidue@users.noreply.github.com>
Co-authored-by: PikachuEXE <pikachuexe@gmail.com>
2023-09-09 18:29:26 +02:00
Jason c371f6035d
Pastel & Hot Pink Themes (#3937)
* Add pastel and hot pink base configuration & labels

* Update Author Background Color to be based on --secondary-card-bg-color instead of --scrollbar-color

This unneeded dependency on the scrollbar color here resulted in the Author Background text blending into its background on the new Hot Pink theme. This change does not tangibly affect any other theme, whose scrollbar colors are incidentally similar to the secondary-card-bg-color, as this color is already being used for tags on the Channel About tab.

* Implement Pastel Pink and Hot Pink styling

Note that Hot Pink styling overwrites the primary and secondary color themes to maintain accessible color contrasts throughout FreeTube. It also updates the underline styling to match its aesthetic. The scrollbar-text-color-hover and side-nav-active-text-color colors are added for allow for the text and icon to both change on hover. This allows for more accessible hover and active styling.

* Add textWhiteSmall and iconWhiteSmall to repo; add FT pink icon themes

The textWhiteSmall was actually already sized exactly the same as the other small text files, so I just changed the name to reflect that fact.

* Add side-nav-hover-text-color and side-nav-active-text-color throughout FT

* Update Hot Pink theme accent-color-active

* Add side-nav hover-text and active-text styling to ft-icon-button

* Fix incorrect variable name

* Disable primary & secondary color theme controls when hot pink theme is enabled
2023-09-01 09:17:46 -04:00
Jason 665da2c1c3
Make certain controls non-selectable / non-draggable (#3947)
* Make settings heading text unselectable

I often encounter the issue of accidentally selecting/highlighting the settings heading text, which ends up highlighting all of the text inside of that settings tab. This is an unpleasant appearance that I have to click to remove. This change removes this issue altogether.

* Switch all instances of user-select to be only user-select and -webkit-user-select

* Make side-nav labels unselectable

* Make side-nav and channels un-draggable

* Remove selection from ft-flex-box, ft-input placeholders, and profile icons
2023-08-27 08:46:19 +08:00
ChunkyProgrammer 2d934eabea
Make profiles keyboard accessible (#3863)
Co-authored-by: Jason <84899178+jasonhenriquez@users.noreply.github.com>
2023-08-14 17:07:57 +02:00
absidue 87a389cce0
Fix focus related race conditions (#3700) 2023-06-27 11:52:39 +00:00
absidue 45d679b84b
Clean up unused component properties (#3458) 2023-04-25 20:03:36 -04:00
absidue 2cd8f0f2d3
Switch from Vue.extend to defineComponent (#3066) 2023-01-18 08:50:02 +01:00
Emma Jiang 79cd65c312
Display long names in profile select (#2964)
* fix the display of names that are too long to fit in the profile select menu

* revert flexbox addition
2022-12-17 14:46:43 +01:00
absidue 27992e47b0
Fix emoji display in the profile selector (#2815) 2022-11-04 07:19:25 +00:00
absidue 3aa080d707
Make showToast a helper (#2695) 2022-10-14 05:59:49 +00:00
absidue c0f98eeafe
Use named parameters instead of $ and % in localised strings (#2685)
* Use named parameters instead of $ and % in localised strings

* Fix URL warning again

* Update placeholders in most locales

* Let the translators fix the problematic RTL strings

* Fix the missing quotes in some of the YAML files
2022-10-13 11:51:15 +00:00
absidue 28e07ec0aa
Replace jquery in the profile selector (#2664) 2022-10-04 17:55:55 +00:00
absidue eaa15ea833
Webpack bundle dependencies (#2511)
* Allow webpack to bundle *most* dependencies

* Exclude *most* node_modules from getting packaged by electron-builder

* Import only the required icons instead of bundling the whole icon pack

* Reduce packaging blacklist to only include the few things that still need blacklisting
2022-09-06 02:29:10 +00:00
vallode 989f37f913
Even spacing on top-nav (#2280) 2022-06-01 15:39:14 +08:00
Svallinn daecf944fb
Store Revamp / Full database synchronization across windows (#1833)
* History: Refactor history module

* Profiles: Refactor profiles module

* IPC: Move channel ids to their own file and make them constants

* IPC: Replace single sync channel for one channel per sync type

* Everywhere: Replace default profile id magic strings with constant ref

* Profiles: Refactor `activeProfile` property from store

This commit makes it so that `activeProfile`'s getter returns
the entire profile, while the related update function only needs
the profile id (instead of the previously used array index)
to change the currently active profile.

This change was made due to inconsistency regarding the active profile
when creating new profiles.
If a new profile coincidentally landed in the current active profile's
array index after sorting, the app would mistakenly change to it
without any action from the user apart from the profile's creation.
Turning the profile id into the selector instead solves this issue.

* Revert "Store: Implement history synchronization between windows"

This reverts commit 99b61e6178.

This is necessary for an upcoming improved implementation of the
history synchronization.

* History: Remove unused mutation

* Everywhere: Create abstract database handlers

The project now utilizes abstract handlers to fetch, modify
or otherwise manipulate data from the database.

This facilitates 3 aspects of the app, in addition of
making them future proof:

- Switching database libraries is now trivial
Since most of the app utilizes the abstract handlers, it's incredibly
easily to change to a different DB library.
Hypothetically, all that would need to be done is to simply replace the
the file containing the base handlers, while the rest of the app
would go unchanged.

- Syncing logic between Electron and web is now properly separated
There are now two distinct DB handling APIs: the Electron one and
the web one.
The app doesn't need to manually choose the API, because it's detected
which platform is being utilized on import.

- All Electron windows now share the same database instance
This provides a single source of truth, improving consistency
regarding data manipulation and windows synchronization.

As a sidenote, syncing implementation has been left as is
(web unimplemented; Electron only syncs settings, remaining
datastore syncing will be implemented in the upcoming commits).

* Electron/History: Implement history synchronization

* Profiles: Implement suplementary profile creation logic

* ft-profile-edit: Small fix on profile name missing display

* Electron/Profiles: Implement profile synchronization

* Electron/Playlists: Implement playlist synchronization
2021-12-15 13:42:24 -05:00
ChunkyProgrammer b1a310ef09
Update colours (search results & select boxes) to match theme (#1482)
* update colors to match theme

* fixed issues with light theme

* readded line that was accidentally deleted

* update colour to match search bar

* update profile selector & dropdown

* increase blur on ft-profile-selector box shadow

* don't change search suggestion background color to primary color

Co-authored-by: Preston <freetubeapp@protonmail.com>
2021-09-23 06:48:40 +00:00
PikachuEXE 8821613d6f
! Fix profile menu toggle button to toggle menu instead of keep opening (#1437)
* ! Fix profile menu toggle button to toggle menu instead of keep opening

* ! Fix togglable buttons to toggle menu instead of keep opening
2021-08-25 15:39:38 +01:00
Svallinn 65df233e8a
Profile+Everywhere: Tweak CSS on profile related components
This commit improves the centering of profile bubble initials
and tweaks other parts of profile related components.
2021-06-16 05:34:37 +01:00
ChunkyProgrammer f6c2e0937b
Fix emoji initials in Profile Previews (#1407)
* updated get profile initial methods

* simplify return statements
2021-06-14 16:59:09 +00:00
Preston 382405cdfe Disable settings depending on others and move default profile logic 2020-10-06 09:38:35 -04:00
Preston e93930ffb4 Add bigger delay before setting default profile 2020-09-20 22:11:03 -04:00
Preston dea4eba109 Fix and add Locales. Add Reverse playlist functionality 2020-09-09 18:58:35 -04:00
Preston d77c9aed49 Add functionality to import and export subscriptions / history 2020-09-06 18:12:25 -04:00
Preston a04ce13e6e Fix linting issues 2020-09-01 23:25:06 -04:00
Preston 8f35f95a5b Finish Core Subscriptions logic and add more locales to profiles page 2020-09-01 23:21:32 -04:00
Preston 1e035105d1 Finish Profile Logic and working subscriptions 2020-09-01 23:21:32 -04:00