## Issue
The sidebar text stuck in English despite already translated.
I'm guessing the i18n macro only ran once for the global object.
## Change
Run the macro on the label when passing it to the `Button`.
## Issue
The previous commit was over-doing the manual syncing, causing other usages like the Repost Modal to always reset to a different channel.
## Fix
Only do the manual syncing when the channel does not exist.
At this point, we could also just take `channel[0]` as the new value.
## Issue
Fixes `4544 Channel-creation in "Tip|Support" Modal shouldn't submit LBC immediately`
## Changes
`Form` seems to have already tried to stop the propagation of `onSubmit`, so I'm not sure why it was still propagated.
Fix by using the same method used in the `CommentCreate`, which is simply to check for `CHANNEL_NEW` as the current selection.
## Issue
Fixes `4621 Can't create Comments if you recently deleted a channel`
The `channel` that the parent passes in is from a persisted state. If the channel has been deleted, `<select>` will automatically resolve to another selectable value. However, `onChange` will not be called for this scenario, so we now have a mismatch.
## Changes
- Manually check if the value has been auto-resolved and report it to the parent.
- An extra `setTimeout` was needed. It seems like `onChannelChange` needs to be called after the first `useEffect` of the parent, otherwise the call has no effect.
## Issue
In the `Autoplay` case, if the `WaitUntilOnPage` has already opened the gates previously, the next video's Related will be loaded regardless of scroll position.
## Changes
Add a `lastUpdateDate` prop to `WaitUntilOnPage` to allow the parent to reset the gating state.
I don't really like the `lastUpdateDate` prop since it's purpose is not intuitive. Is there a standard way to do a "one-time trigger" from the parent?
This allows `RecommendedContent` to render the Card but with an empty list, so that the area isn't totally blank while waiting for `WaitUntilOnPage` to debounce.
There are cases where `WaitUntilOnPage` will incorrectly render, such as at the beginning if the upper components hasn't expanded to full size, so `WaitUntilOnPage` would be briefly visible.
Added a 300ms debounce to fix this, which would also improve scrolling performance a bit by doing less. Hopefully 300ms is enough for the upper components to inflate to full size.
## Issue:
Fixes 4549 `Mature content + navigating to URLs directly`
_If a user navigates to mature content directly, we currently show the page even if mature content setting is not enabled. With our recent mature content verification setting, we should hide the page until the user turns it on - we can prompt directly on the file page._
## Changes:
1. Show basic info of the claim like URL and Title, so that user knows which page is being blocked.
2. Initially, I had 2 "boxes" -- one for the title and another for the message. It felt a bit messy, so `FileTitle` was augmented to house everything in one box.
## Issue
When navigating back and forth between a File and Channel page, the back-action will be laggy (no response) if the channel contains a lot of comments and is in the midst of resolving them.
## Changes
The "full" fix would be to batch-load comments, as this would improve the performance of fetching both Channel and File comments. For now, this commit focuses on the Back action problem only.
Skip fetching comments by not mounting 'ChannelDiscussion' until the tab is selected. I couldn't find anything in the Reach UI documentation on how to not render inactive `TabPanel`s, so I used the straight-forward state method.
## Issue:
Fixes 4411 `"SelectChannel=New" doesn't show all fields on re-entry`
## Code Changes:
`selectChannel`: Correct the value of `addingChannel` in the constructor based on the given props.
(1) This reverts commit 8641a3ee1c.
(2) Fix floating-player misalignment due to YT badge in mobile by hiding the badge.
At first, the suggestion to truncate the left URI to keep the entire thing single-lined was implemented, but during testing, I realized that the YT badge will take up the entire width anyway (especially on other languages). The URI is more important than the badge, and truncating both of them would be ugly.
Given the preference to not have 2 lines for this, we'll just hide the badge for the mobile case.
For the Channel Page case, let's make it single-line through "4454: URL / top claims overlap" instead. We'll keep this commit/PR limited to fixing the YT badge.
## Issue
Fixes 4524 `[mobile] in channel search not available`
## Changes
There are currently 3 wunderbars: (1) header (2) channel list (3) downloaded list.
The additional `wrapperStyle` in the header made it hard to find a solution that works for all 3, so I split 2 and 3 into `wunderbar__input--inline`.
## Issue:
Currently, the checkbox grayed-out state is only correctly updated when changing from "no-file" to "file selected". If you have selected a video file and later changed to a text file, the checkbox doesn't gray out.
## Code Changes:
`fileVid` wasn't being updated for the case of non-videos; now it does.
## Issue
Closes 3964 `Add Youtuber info to file page`
## Changes
(1) Refactor the YT-info query into `YoutubeBadge` component.
(2) For the File Page case, don't show "- last sync <date>" since the date has nothing to do with the file.
## Test
[x] YT Channel page
[x] YT Channel's claim page
[x] Non YT Channel page
[x] Non YT Channel's claim page
[x] No channel (anonymous) claim page
[x] Various RENDER_MODES
## Issue
Closes 4501 `Font size`
## New behavior
The Desktop app can now zoom the same way as browsers:
- Zoom In: "Ctrl+=" or "Ctrl+numpadPlus" or "Ctrl+WheelUp"
- Zoom Out: "Ctrl+-" or "Ctrl+numpadMinus" or "Ctrl+WheelDown"
- Zoom Reset: "Ctrl+0" or "Ctrl+numpad0"
## Code changes
(1) Electron provides this functionality through the `zoomIn|zoomOut|resetZoom` roles in the Menu, so it would have been a quick job.
However, given that Electron currently does not support having multiple accelerators for one item, we can't add `Ctrl+WheelUp` to the mix and would have to implement our own handler and use `webFrame`.
Given that we need to add code anyways, we handle both keyboard and mouse cases through the same handler, hence the existence of `zoomWindow.js`. It also provides the opportunity to few a few quirks with Electron's default implementation (e.g. stuck at both extremes)
(2) I recall there is another Issue for adding keyboard shortcuts. Given that these shortcuts are universally used in browsers, they are probably "reserved", so shouldn't clash with that task.
## Issue
Fixes 2675 `Claim search with exactly 20 results keep fetching next page`
## Changes
Use `claimSearchResultLastPageReached` (I didn't know it existed back then).
The unnecessary "loading" refresh will still happen one time, but at least now it doesn't happen every time we scroll to the bottom (and incorrectly incrementing 'page').
This is a follow-up on PR-4392.
## Issue:
The previous PR covered "pop from within the same page but with different query/order", but missed "pop after entering a claim".
1. Click `Your Tags`.
2. Set order to `New`.
3. Restart app or reload (crucial step)
4. Click `Your Tags`.
5. Click any claim.
6. `Back`. The order incorrectly resets to `Trending` -- it should stay at `New`.
## Issue
- The diff for new strings are polluted by the need to add a comma to the previous entry.
- Having to re-add the newline at the end of file before commiting is a repetitive pain.
## Caveats to this approach
- When manually adding strings, developers need to put it above the `--end--` entry. Hopefully it is obvious without having to put verbose comments like "^--- add new string before this line ---^"
- Translators will surely ask how to translate "--end--".
The `UserPasswordReset` can be accessed in two places:
(1) While signing in
(2) From the Settings Page when changing password.
This commit:
- maintains the existing `Cancel|X` behavior for case-1, which is to remain in the Sign-in page.
- For case-2 and any future direct-entry, we'll simply call `goBack()`.
CT - Chinese Traditional
CS - Chinese Simplified
Note that if English subsets like en-GB is enabled in the future, the default 'en' value used throughout the code (including in redux.git) needs to be changed to 'en-US'.
## Issue
Fixes 4293 `Better download link support`
- [x] make it so you can right click a download button > copy download URL
Given that this could be useful in mobile/web as well, I used a button+modal instead of the right-click approach.
- [ ] in share dialog, show download URL to copy for non-video content
This is already implemented, albeit hidden in the "More..." expansion.
## Issue
Fixes 4460 `unmuted state lost / reverted`
1. Play a video.
2. Press mute.
3. Drag the volume bar to unmute.
4. Play a new video --> the video starts muted.
## Fix
The `volumechange` handler was comparing against stale variables, so there are times where the state was not saved. Just save both `muted` and `volume` without additional gating (the gating is probably unnecessary in the first place, since we are in a onChange function).
- Missed the "Account Password" card that is used for authenticated case.
- For cards that are only used in Settings, listen to the language change in "select" instead of passing in as a prop. I think this is cleaner.
## Issue
4332: Video transcode setting not reflected correctly (MP3 incorrectly transcoded to MP4)
2 issues here:
(1) The checkbox is mixing between user state and logic state.
(2) The variables (e.g. `optimize`, `isVid`, `filePath`, etc) will have values from the previous operation when you enter Publish Page, so GUI issues beyond Transcode can be also produced (e.g. showing Transcode enabled for an image).
## Changes
The "Transcode" checkbox state (checked vs. unchecked) will now reflect the user's desire and will be a persisted state. Whether or not this setting is used will be reflected by the checkbox's grayed-out state (i.e. it can be checked for non videos, but it will be grayed out).
## Fixes:
4220
## Changes:
For `vjs-layout-small`, there is still space to display the said controls. This layout covers devices like Galaxy S5 up to Nexus 6P.
For layouts smaller that that (e.g. 'vjs-layout-xsmall'), they will remain hidden.
## Fixes:
4351: "Infinite load won't work if the same sort option clicked"
Test case:
1. Click Following
2. Click New
3. Scroll down to load at least 1 extra page.
4. Go up and click New again.
## The Issue:
`scrollBottomCbMap[page]` in this case did not reset since the `id` remained the same.
## The Fix:
I don't know how else to notify the effect to run. Perhaps "when `page=1`" is one criteria, but I found that removing `scrollBottomCbMap` can also fix it.
I don't know what scenario that `scrollBottomCbMap` was originally meant to handle, so will need to depend of reviewer to confirm I did not break something else. This fix assumes that recent inf-scroll fixes and debouncing would have addressed the "weird stuff happening with fast scrolling" problem mentioned in the comments.
The previous code was simply delaying the handler, which served the intention of the time, which is to avoid using the wrong coordinate from querying too early. However, we ended up servicing each scroll message.
This is the proper fix, and should technically make scrolling smoother. Maybe this will fix 3576 as well, although I don't see much difference.
## Fixes:
3071: "Infinite scroll stops working when navigating to file page / back"
## The Issue:
In the POP operation, the `page` value is back to 1 due to the initializer `useState(1)`. If the results cache already contained more than 1 page's worth, then the rest of the logic thinks there's nothing to do.
## The Fix:
Previous fixes to Inf-Scroll added a "page correction" code to handle the mismatch. This fix simply adds this scenario to the list of scenarios to perform the correction.
## Fixes:
4214
## Approach:
`ClaimList` currently only shows the loading indicator if there is a header. We could make the indicator always appear at the top of the list when `loading=true`, but that would be the list jump up and down as the indicator appears/dissapears. I assume that is too distracting and is the reason why it was not made that way in the first place.
Show the indicator in place of the Refresh button while fetching instead.
## Fixes:
3641 Language switch does not take effect right away
## Assessment:
Although `Card`s in the Settings Page are actually being re-rendered, the `actions` within them might not be getting the signal, depending on their props.
## Changes:
(1) Pass the language variable to the `actions`'s props for items that are affected.
(2) Make the Wunderbar listen to language-changes as well (the only component outside of Settings that would need an immediate update).
1. Use a constant for the classname instead of being hardcoded.
2. Use existing 'debounce' function instead of introducing another.
3. Added changelog entry.
Fixes #-4021.
## Changes:
When the autoplay overlay gets partially off-screen, the timer will be stopped. We can tweak how much down it needs to be scrolled.
When timer is paused, the countdown resets.
The pausing mechanism has no effect on the floating player (since the 'top' can never go negative). This behavior is the same as another big video platform.
---Fixes:
#-2882: "Fix UX around publishing to already published URL".
---Changes:
1. Improved the error message (change color to red; emphasized the URL; tweaked the sentences a bit).
2. The `Publish` button will be grayed out in this scenario, until user explicitly decides to edit existing claim instead.
--- Issues:
(1) #-2669: Page does not restore to top when navigating new tags.
(2) "Encountered children with the same key" error (duplicate entries shown).
https://github.com/lbryio/lbry-desktop/issues/4367#issuecomment-645449206
--- Changes:
(1) Ignore the history if it's a new query (i.e. explicitly clicked). The BACK history will still behave as normal (doesn't reset to top).
(2) Previously, the `page` variable will continue to increment as you scroll and stay within the page (e.g. Trending vs New, or clicked another Tag). As you move between queries, we hit a scenario where `page` is significantly under or over the latest retrieved `claimSearchResult.length`. This messes up the rest of the code.
Fix by correcting the value of `page` according to the current `claimSearchResult.length` when necessary.
--- Issues:
(1) #-4394 add persistence to new support modal.
(2) Should collapse the custom field when presets are selected.
Even though the Send button repeats the amount for Tip, it's still confusing to see both the Preset being active and Custom numeric field visible.
(3) Missing localization tags.
Implementation:
- The code is placed in <VideoJs> instead of <VideoViewer> as we need to control the video itself. It's more self-contained here, rather than trying to pass refs around between parent and child.
- useState cannot be used as it will cause a re-render when the hint it clicked and dismissed. The DOM is used to hide the button.
--- The bad scenario:
A less popular tag like 'kanji' yields only 23 results today. The code continues to increase the page count. We'll either see some blank page glitches at the bottom, or repeated entries being shown.
--- The fix:
Assume that an unfilled page means "no more results" and stop incrementing the page. This seems true based on empirical evidence.
If you are at the bottom and you hit the UP_ARROW key one time, the logic still thinks we are at the bottom, despite the component has clearly moved. Similar to the issue noted in the previous commit, this causes the page to increment incorrectly.
My wild guess is that the previous logic depends on the css height, so it might got broken due to css changes. Hopefully the new calculation is more robust and works for all cases.
---The bad scenario:
If you're at the bottom and you go up using UP_ARROW or HOME key, the coordinate is still at the bottom if we service the callback immediately. This causes 'contentWrapperAtBottomOfPage' to be true and we ended up incrementing the page unnecessarily (even for searches that no longer yield any extra results).
---Fix:
Fix by adding a delay. The value can probably be fine-tuned further.
---The issue:
When switching between tags, the selector defaults back to Trending even though you had another option already selected.
---Changes:
- 'orderParamUser' will store the last user state persistently. The persistent state is also made unique for each page (i.e. Your Tags and All Content will be unique).
- If the parent component passes in a specific order, that will be respected and will also become the new persisted value. One example is "Your Following", where it always starts at 'New'.
- Handled navigation history correctly
The test case:
- Enter "Your Tags" (assume start at 'Trending')
- Click 'New'
- Click 'Top'
- Back
- Back (it should return to 'Trending')
As the top page history does not have any "?order=" value, we ended up with a no-op for the last Back. 'orderParamEntry' is added to handle this.
Two issues:
1. Values not marked with __()
2. Split sentence.
For #2, it seems like there are translations that don't make sense when combined, because the values are being translated independently from full sentence in Transifex. Decided to just make it full sentences.
The MDE used in the "new" section has a parent width parameter to limit itself, while the MDE used in the "edit" section didn't.
Fix by limiting ".comment__body_container" to 80%, which takes into account the space taken by the author's avatar. This feels a little bit dirty since it's hard-coded. If there's a way to calculate the avatar width from here, it will be more robust.
Removed space to sync the text "LBRY takes privacy and choice seriously. Just a few questions before you enter the land of content freedom." with that from app-strings.jsx
Currently, the input field goes off-screen if the read-only prefix is too long.
Given that the prefix is read-only, the user probably knows what the prefix is from context. e.g. In the case of the Repost Modal, the prefix is repeated in a selection field above. So, it's probably ok to just truncate the text to an ellipsis.
The input field is the more important one here, so giving it 60% width when truncation is needed.
Implementation:
- <StatusBar> listens to 'update-target-url' and will show/hide itself as needed.
- Handled the display of "lbry://" protocol.
CSS:
- The colors chosen should work on both Light and Dark Theme.
- The delay is necessary to avoid blinkies when the mouse is moving around.
#4259
Fixed color issues that were making things hard to read:
- selected text color, including inline code.
- HTML tags
- Horizontal rule not visible in Preview mode. While at it, I changed the color in Edit mode as well as syntax highlighting.
- blockquote (was gray over gray)
Attempted to fix uneven margins between top and bottom for inline-code and codeblock. Also, removed the extra margin to make it more nice and cosy, instead of far apart.