I think using the 'values' for the keys should be fine since each language name is unique. A key-clash would also help us catch mistakes like not differentiating sub-languages if support any (e.g. "English" vs. "English (British)")
Had to cast to String for lint.
- SUPPORTED_SUB_LANGUAGE_CODES[] that I introduced was pretty redundant when SUPPORTED_LANGUAGES[] already hold the information. The logic to ignore sub-languages (i.e. reduce the locale's "en-GB" to "en" is now located in getDefaultLanguage()).
- SUPPORTED_BROWSER_LANGUAGES[] and SUPPORTED_LANGUAGES[] look so similar and hard to tell what the former is for at first glance. The functionality to map 'zh-CN' to 'zh-Hans' is now handled by resolveLanguageAlias(), which makes the intention clearer.
This leaves us with a single list -- SUPPORTED_LANGUAGES[], whose key also tells us the desired language code to use.
Also, clients now need to call `resolveLanguageAlias` to map any language code aliases, as they differ depending on how it is queried (e.g. `navigator.language` vs. `app.getLocal()` uses different standards).
I think we no longer need to explicitly migrate existing user's 'zh-CN' into 'zh-Hans' because the rest of the system will always use the desired language code as long as 'resolveLanguageAlias' is called appropriately. e.g. the system uses `selectLanguage` and `selectLanguage` calls `resolveLanguageAlias`.
## Issue
Closes 5811: Video-embed in markdown-post is broken
- Revert "Fix 'makeSelectIsPlaying' to look at 'playing' instead of 'primary'." dabdc980a1.
- Revert "Fix 'isPlaying' to reflect 'playing' instead of 'primary' URI" 351890decf.
Reverting means "Deleting MD from downloads list causes spinning icon to run forever 4959" gets re-opened, but this is a way less severe issue to leave in.
Closes 5000: AutoPlay in Floating Player only works one time
Factor out the code that queries the recommendation. It needs to be called in two places:
(1) `RecommendedContent` - need to cover the case of floating player + visit another video page.
(2) When video is floating and autoplayed the next video.
## Issue
Closes#5720: Edit: channel-selector should re-populate with original channel
## Notes
'incognito' was not set to false, causing the 'ChannelSelector' to select Anonymous.
- remove anon option in channel dropdown when livestream tab is selected
- attempt to fill publish form with current active channel name just prior to publishing to (edge condition)
- edge condition occurs when user fills out form fully. User switches to Post (which allows anon in drop down selector). User selects Anon channel, then switches back to the livestream tab. The form was previously updated with `channel: undefined` but does not get changed when clicking the livestream tab. So we just updated the form one last time prior to publishing as a livestream
- Show most recent livestream claim on livestream setup page instead of first livestream claim
## Issue
Closes 5687: Ensure post mode has no text limit
## Changes
- `type="markdown"` can now have unlimited length if clients don't define `textAreaMaxWidth`.
- The internal default limit of 2000 is narrowed down to `type=textarea`.
## Issue
Closes 3661: Autoplay + Related go into loops ( infinite ) sometimes
## GUI
Push the actual "next" item into the top of the list.
## History search
1. Skip if the next item is itself.
2. The URL stored in the history comes in various forms, so a direct comparison won't work.
- There's also a weird case where the URL differs by just a little (p.09 vs p-09), but with the same claim ID:
lbry://vacuum-tube-computer-p.09-–-building#5212bc8bc63c373e2bf1ebc5b765595ed7b6514d
lbry://vacuum-tube-computer-p-09-–-building#5212bc8bc63c373e2bf1ebc5b765595ed7b6514d
Check the claim_id as well to cover cases like these.
## Changes
- Restore original code for how Volume and Mute is restored.
- Playback rate will be only change that gets "re-restored" in "loadedmetadata".
## Issue
5513: Video-setting persistence broken
## Notes
- Per videojs recommendation, the setting-restoration should be done after the video has been loaded, so the action was moved to `loadedmetadata`. This fixed the volume slider problem, and should have fixed the playbackRate too.
- For playbackRate, there is another special case where it gets reset to 1 (refer to comments in code).
## Issue
Closes 4936: Don't process markdown formatting as lbry:// url previews
## Approach
Preamble:
- We want to convert plain `https://lbry.tv/befreeonlbry` to an embed, but not `[blah](https://lbry.tv/befreeonlbry)`.
- At the markdown/remark level, both formats resolve to the same node type, having a `link` and a `text`, with the 'text' being auto-filled with the `href` if there is no label.
Fix by assuming the link is the non-labelled format if the `text` is the same as `href`.
This opens up one corner-case that we can't handle, which is when the user explicitly set the label using the href, e.g. `[https://lbry.tv/befreeonlbry](https://lbry.tv/befreeonlbry)`. This will still resolve to an embed. There's not enough data at the parsed level differentiate this case -- we would need to parse the content ourself before `remark`, which I think is not worth it.
## Aside/Reminder
If you see that the link doesn't resolve to an embed regardless of the format used, that's probably just due to `5636: Disable video previews in comments/posts made by channels below a certain channel staked level`
- Channel About
- description: seems handy to have a preview, so pulled in the "allowed" logic.
- email: shouldn't render preview at all
- website: shouldn't render preview at all
- Publish Preview:
- description: there's not enough height anyway, so don't render preview.
## Issue
- Closes "Wunder: Keyboard typing confusion" (https://discord.com/channels/362322208485277697/377895389992321064/784309720293965824)
- Closes 5316: "Home and End keys not working in search box"
## New behavior
Home/End key now behaves like it normally would in a typical text box, i.e.:
- Brings you to the start or end position.
- Adding a <Shift> key also selects the text from the current position.
To select the top or bottom item in the Suggestion Popup List, use Ctrl+Home/End instead (without this change, it was just Home/End previously).
## Approach
Adding the listener at the element level allows us to run it before the component's listener.
## Issue
Partially closes 3041: Display/hint what keyboard shortcuts are available in videos
(minus the "all shortcuts" overlay -- saving that for another day)
Closes 5597: batch resolves on channel search page
Do a batch-resolve immediate after getting the results and before setting the result variable, as the latter would result in the Claim* components resolving individually.
I enabled `returnCachedClaims` -- I assumed that's a reasonable thing to do. I don't see other places use it, though, so highlighting it here.
## Issue
5554: Video: loading circle sometimes does not appear until 2nd click
## What's happening
videojs behavior:
(a) A `src` change makes the Play button re-appear.
(b) An `onPlay` (or `play()`) makes the button go away.
Due to the `m3u8` header async fetch (i.e. return is potentially delayed), the initial `onPlay` (which cleared the button) that happened after user clicked Play gets negated by a potentially-delayed `src` change.
# Changes
- Manually hide the play button that is induced by the change in `src`. In the fetch-delay scenario mentioned above, the player continues to be in a 'playing' state anyway.
- But don't hide the button if paused externally (e.g. browser-level)
Restore video loading circle
## Issue
- Second attempt at 5500: Allow right click + report feature on tiles
- Related: PR_5531
## Notes
Although the link can already be easily copied on web, the menu item is still retained for consistency between the platforms.
https://discord.com/channels/362322208485277697/363087331475062785/815132676293918730
- Renamed `closeInlinePlayer` to `clearPlayingUri` to reflect it's actual function.
- Add additional check to see if the current video is actually inline before closing it.
Wanted to refactor out an actual `closeInlinePlayer`, but let's wait until there are more usages.
Looking at a few other files hoping to understand the convention for components, I moved the videojs.scss file to where all CSS related files appear to be in the project.
Also restores the CSS for vjs-overlay which I commented out previously for *some* reason (but I don't know why, and it doesn't seem to make a difference whether I comment it out or not)
if blockedList takes a while to return, the app would call claim_search once without the blocked list, then again with the block list. just hide them in the ui
* initial support for block/mute
* hide blocked + muted content everywhere
* add info message for blocked/muted characteristics
* sort blocked list by most recent block first
* add 'blocked' message on channel page for channels that you have blocked
* cleanup
* delete unused files
* always pass mute/block list to claim_search on homepage
* PR cleanup
## Issue
Second attempt at 5571: Limit description length on channel edit
## Changes
- Undo #5573: restore limit back to 5000.
- Translate the `bad-txns-claimscriptsize-toolarge (code 16)` error into `Transaction limit reached. Try reducing the Description length.`
## Issue
Closes 4505: Highlight url instead of text when embedding a link
_Too used to Github's editor behavior, so was annoyed at this too. It makes more sense to highlight the URL placeholder since that needs to be filled._
For to the unhighlighted case, then the cursor should be at the Label.
## Changes
Until the upstream code decides to fix it (`github::Ionaru/easy-markdown-editor/issues/85`), we'll handle it ourself by listing to the 'changes' events.
## Issue
- Most titles don't fit the embed container width. I wish to know what the title is without having to click on it first.
- Also, add clarity that the LBRY icon brings you Home.
## Issue
The removal of `svg` from `media__subtitle` in 09b689ba made the icon black.
## Fix
Both 'Open File' and 'Download' should have the same css class.
## Issue
5219: Add content type and language filters to channel page
## Notes
There is a quirk in the dropdown (see 5542: Language filter doesn't reflect effective setting if language is outside of `SEARCHABLE_LANGUAGES[ ]`)
Included the memes as well per translator request. I've been excluding it since I wasn't sure if memes can be translated, but I guess they can change it to something equivalent in their language.
Adds custom video.js hls quality selector plugin
This allows the quality selector plugin to stay active and listen for source changes on the player to prevent the need to recreate the player when switching between MP4's and M3U8's
## Issues
5349: Remove theater mode button from player in comments
5519: Theatre mode button doesn't do anything in full screen mode [Odysse/LBRY desktop app]
## Notes
5349: Wanted to hide for 'markdown' as well, but it seems useful for 'markdown' (to clear the screen from Related), so I did not include it.
## Issue
5438: Keep floating player in view area
## Changes
- Restore correct z-index
- The bug came as a side effect of cbac2174. Redo cbac2174 to cover both close button and floating player.
- Remove wobbling when dragging to bottom-right.
- The extra gap introduced is fighting against react-draggable. If gaps are needed, handle it entire ourselves or do it somewhere in react-draggable; neither is worth the effort, so the gap was removed.
- Fix i18n concat problem for some languages.
- Display the same label (specifically, the recommended aspect ratio) for both URL and UPLOAD. I think the string "File to upload" can be omitted, but I left it as-is.
- Remove old/unused strings.
Continually recreating video.js instance on render is bad.
Instead, persist a single instance, and simply update the source and poster on the existing instance.
I'm a bit wary of adding props to this component due to the 'dispose' call, but I think 'source' and 'claim' will update together, so it shouldn't be an issue?
## Issue
5308: Ability to choose default play speed and theatre mode or regular playback size
## Comments
Initially, I used the local storage, as per 'muted' and 'volume' -- I thought that would be appropriate.
Later, I saw that Theater Mode is already using Client Settings, so I re-did everything to match that.
Also, there is an accompanying commit in lbyr-redux.
## Issue:
5119 "Video: Mobile UI + overlay for keyboard shortcut feedback" was disabled because the feature broke the chromecast button in Android Chrome
## Issue
5204: Don't autoplay when commenting/video off screen
## Change
Previously, the checking was only done during a scroll event. We also need to check if the user has already scroll down before the component was invoked.
Clearer display of takeover amounts
Repost from empty search result, from top page, or from claim
review changes
final touches
bump
empty comment copy
they
emptier
validation cleanup
extra
## Issue
5130: Support mailto hyperlinks / urls in markdown
## Change
The markdown components already support mailto, just that the logic here ended up making it a 'ClaimLink'
## Issue
5090: When sorting channels, switching between Trending/Top/New returns viewer to the top of the page
## Approach
- Add an optional parameter to `ClaimListDiscover/Header` to add an additional anchor ID when building a new search URL.
- Clients then add the anchor ID on the desired location.
- The code that handles the scrolling then checks if the `location` contains an anchor hash. If it does, we'll scroll to that element; else, the existing behavior will be used.
## Issues
(1) 4783: New search query does not reset to the top
(2) The current way that Tag Search resets the position can be overridden by the AppRouter's call.
## Approach
Listen to `search` changes as well. This basically covers any search param changes.
Components should probably not call `window.scrollTo` directly as the AppRouter's call might override it.
The only downside to this new implementation is that the top-most (or right-most?) scrollbar won't get the customization. Any other sub-components (e.g. sidebar) will get the customization.
My guess is that the "top-most" scrollbar is above the `main-wrapper`. I'm not sure if we can (or should) add another className higher than App.
The impetus for the customization was the ugly sidebar anyway, so at least we covered that.
4913: Can't slide volume slider in pop out mode
I first tried to handle this at the floating player level, but it was impossible to hack there due to how 'react-draggable' works (it already moved the window before the "move" handler is called, so we can't do much).
Fix by overriding the dragging behavior of the videojs' VolumeBar class by not propagating the event further. It is odd that videojs didn't already do this, since it's SeekBar does stop the propagation.
## Issue
4609: If claim search on latter page fails, don't clear out all previous data
## Note
This requires an accompanying change in `lbry-redux` to mark `claimSearchResultLastPageReached` during timeout and to not purge past results.
## Change
The previous flow was: increment the page, and expect the next render to either be 0 (timeout + purge) or fill in at least 1 new item.
Since it is now possible for no results to be returned for the new page (due to timeout + no purging), the code continues to make another query. This commit stops the perpetual querying.
## Test Case:
1. https://lbry.tv/$/discover?t=imherelbry&content=video&order=top&fresh=year
2. Scroll down a few pages until it timeout happens. Past results are gone.
## Issue
In the odysee branch, the tooltip for "Following" in the Sidebar was shown as "Following --[sidebar]--". In lbry.tv, the tooltip doesn't appear.
I believe the tooltip appeared due to the name change from 'label' to 'title' and then being passed to Button through '...passedProps'.
Fix by explicitly setting the Button's 'title' to the localized text.
I believe we don't translate these since this is already the translated form?
When the language is supported later, the English version will be added to the string database instead.
## Issue
4393: Tag query URL goes on indefinitely as you change between [Trending|New|Top]
## Change
Change from `append` to `set` when building the query to remove duplicates.
Flow hates null being not a string, so the FixMe was retained.
## Note from Russian translator
"To/From" in the 'automatic dark mode setting' cannot be re-used for the one in the 'Tip Modal'.
## Change
Wanted to split this into "general" and "time", but I'm guessing it won't satisfy all languages, so we'll just use the usage as the context since there's just 2 instances.
The "Report Content" button was the impetus for this, as there was no way to know what that button is for unless the user clicked it (or smart enough to decipher the icon).
3465
## Issue
The abrupt cut-off of the expandable section bugs me (looks like a rendering glitch), especially when it cuts off in the middle of a line.
## Change
In addition to the existing 'More' button, we fade out the section to provide additional visual cues.
## Approach
This solution doesn't require the background color to be known, so it will work regardless where <Expandable> is used, or whatever color-scheme is chosen.
However, it does utilize non-standard css -- for older browsers, it should simply cut-off like the before.
This option allows users to bypass the "publish preview" modal. Users can disable it by checking "don't show this again" in the modal, and re-enable it in the Settings Page.
This requires an accompanying change in lbry-redux. Search for "SETTINGS.ENABLE_PUBLISH_PREVIEW" in the commit message to find the commit.
In Edit Mode, the preview will not appear. Not sure if it's needed, plus there are more things to handle in Edit mode (e.g. which items are changed)
- More missing strings
- Moved strings around to keep related strings together (easier for translators to guess the context)
- Removed translation macro for blank string
- Fix typo for 'Neetwork'
## Issue
4797: Markdown preview breaks when using a lbry link in angle brackets
This is similar to the Embed case in commit dbcd677e.
## Change
Replaced it with a dummy link that looks like what the final outcome would be, but would not be clickable.
Again, similar to the embed case, unless there is a way to pass the store over, I don't have an alternative that makes sense: Adding a dummy router or replacing it as a regular <a> will just make React spew security errors.
Not being able to click it is not ideal as we (as a user) can't verify our links, but it's better than the current case of not rendering anything at all.
remove previous changes,keep syncpref in wallet, change anon wallet pref key to local
sync choices wip
dont relocate syncenable setting
bump
no prefs on web unauth
bugfix redux bump
pull after sync change
bump
## Issue
4644: Markdown Preview breaks when <iframe> is present
Error: "Invariant violation: could not find 'store' ..."
## Change
Until we figure out a way to pass the store to the SimpleMDE preview formatter, just replace the embed with a stub region.
## Issue
The previous code only handled the clamping if the FP is already floating when the main window is resized.
1. In fresh Odysee session, the floating player is always clipped on the right.
2. If you resize the desktop while not floating, the FP could be clipped when you go into floating mode.
## Changes
- Factor out the clamping code.
- Add another effect to handle 'isFloating' changes.
## Issue
4741: `Pop out player disappears or is cut off`
## Approach:
- When dragging stops, determine the location of the floating player with respect to the main window in terms of percentage.
- When window is resized, roughly re-position based on the stored percentage.
## Issue
4669: `Download doesn't trigger on web until 2nd attempt`
The issue only happens when _Autoplay_ is disabled in the User Settings and the video hasn't been loaded when _Download_ is clicked.
The following code:
`if (didClickDownloadButton && streamingUrl)`
didn't triggered because:
1. `streamingUrl` has not resolved yet when the Effect ran.
2. When it did resolve, the parent component was also notified and unmounted things, causing `didClickDownloadButton` to reset.
## Approach
Avoid the unnecessary unmounting by not using a conditional section wrapper within a return statement. React probably couldn't do the diffs when the conditional is at a section level.
## Issue
4708: Bring back tag list in side bar when Tags view selected
## Approach
- Instead of displaying either Channels or Tags, both will now be displayed.
- The tags will simply be a the same button component as the "channels", but with a "#" prefix. This simplifies the CSS-side changes, and looks better overall as well.