Commit Graph

20 Commits

Author SHA1 Message Date
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 af2913592e
Add SUPPORTS_LOCAL_API build flag (#4931) 2024-04-12 06:12:50 +00:00
absidue 2f29084d4f
Remove unused isLoading from ft-community-post (#4684) 2024-02-19 11:02:32 +00:00
absidue 161633d1d9
Include swiper version in CSS file name, for cache busting (#4685) 2024-02-19 10:58:59 +00:00
absidue 205924c33b
Workaround community post slider dependency incorrectly calculating its size (#4598) 2024-01-30 00:32:49 +00:00
Jason 64e3f32f78
Video title filter / blacklist (#4202)
* Implement hiding of videos with user-inputted text

* Implement ft-input minInputLength

* Enable for playlists

* Enable feature on channel pages

The premise for this change is that users would not want to see that forbidden content anywhere, as opposed to hidden channels, where you're clearly on a channel page to see things from that channel.

* Fix 'Play Next Video' playing forbiddenTitle videos and hidden channel videos

* Fix issue of hidden recommended videos taking up vertical space

* Rename variables to better match non-video-specific function, and remove blocks from History and videos in playlists

* Fix to respect hideForbiddenTitles value

* Modify label

* Clarify restriction affecting original titles

* Add toast for entered input of length below min input length

* Add toast for element already exists

* Update to not clear if duplicate tag is entered for Hide Forbidden feature
2024-01-22 17:59:46 -05:00
absidue 02ee4c8148
Only bundle the Swiper modules that we use (#4455) 2023-12-16 13:50:09 +00:00
ChunkyProgrammer d6a6cc0349
use swiper.js instead of tinyslider (#4427) 2023-12-08 20:24:08 +01:00
ChunkyProgrammer 47ef3e5746
Subscriptions: Add community tab (#3973)
* Add subscription community tab

* fix up community tab

* simplify if statement

* use global.community for all references to community

* dont show community when useRss is set

* check visibleTabs for showing the community tab

* fix caching, decrease datalimit for community, add missing translations

* L: Hide shared posts, IV: Don't show errors for empty community tab

* add links to related issues
2023-09-23 00:19:50 +00: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
Wesley Appler 4a7c4d95bf
Refactoring to community polls & fixes for quizzes (#3865)
* Refactoring to community polls & fixes for quizzes

* Replaced the interactive quiz with a reveal button and small fixes

* Replaced the interactive quiz with a reveal button and small fixes

* Implemented vote formatting

* vote translation fix

* Accessibility additions

* Fixed local API is_correct typo

* Fixed inconsistent indents
2023-08-24 22:26:31 +02:00
Svallinn f7b7fe549b
Fix+Chore: Remove crop directives from community post's images (#3734) 2023-07-09 08:09:26 -04:00
absidue 15b8dffaf3
Fix text wrapping for community posts (#3540)
* Fix text wrapping for community posts

* Use anywhere instead of break-word for overflow-wrap
2023-05-22 09:43:13 +08:00
absidue 6804ca999d
Remove unnecessary dislike icon on community posts (#3524) 2023-05-10 08:30:00 +08:00
absidue 45d679b84b
Clean up unused component properties (#3458) 2023-04-25 20:03:36 -04:00
absidue 5fb298b740
Improve performance of list elements and icon buttons (#3355)
Co-authored-by: PikachuEXE <pikachuexe@gmail.com>
2023-03-27 06:25:58 +00:00
Emma 86962f2802
Improve community tab responsiveness (#3344)
* Make channel page 📱responsive again

* Even out padding on the inside of `ft-community-post`
2023-03-22 13:44:19 +01:00
absidue da0c06902b
Use smaller Vue esm runtime build (#3271) 2023-03-07 07:06:42 +01:00
Luca Hohmann 4ef2f709ee
Channel community page (#1568)
* Comunity page strings, Communtiy tab, Community initial API call
Added:
1) Community page strings - the first few strings are now available
2) Community tab - A clickable tab is now displayed on channel pages
3) Community initial API call - on loading the page, the initial access

* Comunity page strings, Communtiy tab, Community initial API call
Added:
1) Community page strings - the first few strings are now available
2) Community tab - A clickable tab is now displayed on channel pages
3) Community initial API call - on loading the page, the initial access

* Data returning added

* Comunity page strings, Communtiy tab, Community initial API call
Added:
1) Community page strings - the first few strings are now available
2) Community tab - A clickable tab is now displayed on channel pages
3) Community initial API call - on loading the page, the initial access

* Data returning added

* Images are now displayed in the community tab

* Comunity page strings, Communtiy tab, Community initial API call
Added:
1) Community page strings - the first few strings are now available
2) Community tab - A clickable tab is now displayed on channel pages
3) Community initial API call - on loading the page, the initial access

* Data returning added

* Images are now displayed in the community tab

* Added primitive video display

* Current changes

* Added preston's change with the ftcard and started on some layout basics

* Created Community Post Component and added fetch more button + functionality

* Fixed problem with videothumbnails not loading and adjusted their height to 100% in the ft-list sass file

* Added poll and ft-list-video to the community page

* Added author name placeholder (missing in module), the published date, the likes and dislikes as well as comment counts to posts. Additionally scaling of images was added

* Added basis for community page playlists

* Finalized a setup for playlists when wide enough

* Fix for missing key in custom list

* Added publish date translation

* Add empty alt tags

Co-authored-by: Jason <84899178+jasonhenriquez@users.noreply.github.com>

* fix accessibility issue

Co-authored-by: Jason <84899178+jasonhenriquez@users.noreply.github.com>

* change: ununique ids to classes

* add missing alt tag

* Redirect channel/id/community to the channel's community tab

* update yt-channel-info

* update to 3.0.1

* Update yarn.lock

* add basic multiImage support

* use tiny-slider for multiImage community posts

* update getChannelCommunityPostsMore

* Update yarn.lock

* fix yarn lock

* swap community and about tab

* Update yarn.lock

* Fix missing comma

* Removed trailing spaces

* Clearing all community post data when changing to another channel

* Restructuring of how the post cards are added, Empty page text,
ft-element-list props customization
1) Now the community page uses the same setup of ft-element-list as the
other pages on the channel.
2) If no posts are available, now it displays a message saying so
3) The ft-element-list component's display style can now be forced into
a certain display mode (list/grid) with the new prop. It will overwrite
the corresponding default value for list display

* Fixed display text path

* Fix lint"

* Adjusted css to fit to new layout

* Final touches community page to tidy up the console

* fix icons, fix linter

* fix hiding showmore button for community page

* fix showToast calls

* change all this.showToast to showToaast

* reinstall tinyslider

* use helpers

* small fixes

* fix: getting continuation of community posts

* remove unused code

* improve slider style import

* fix hiding 'ShowMore' button

* fix weird typo in css

* add invidous community tab support

* remove console testing code

* Apply suggestions from code review

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

* implement suggestions, improve thumbnail replacement

* use flip horizontal

* readd invidious fallback code, remove author name workaround

* replace another google domain when using invidious

* suppport invidious multiImage posts

* Use youtube.js for community posts

* add invidious polls, remove support for fetching more

* reorder icons alpabetically

* re-allow loading more when using localapi

* fix styling of multiImage, hide NA text

* fix loading playlist

* fix spacing of items

* fix issue with direct url to community tab

* make review recommendations

Co-Authored-By: absidue <48293849+absidue@users.noreply.github.com>

* fix displaying selected tab, get best quality image

---------

Co-authored-by: Preston <freetubeapp@protonmail.com>
Co-authored-by: ChunkyProgrammer <78101139+ChunkyProgrammer@users.noreply.github.com>
Co-authored-by: Jason <84899178+jasonhenriquez@users.noreply.github.com>
Co-authored-by: absidue <48293849+absidue@users.noreply.github.com>
2023-03-04 16:56:04 +08:00