Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add randomizeFilename toggle to QuickReply #2927

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

paradox460
Copy link
Collaborator

@paradox460 paradox460 commented Feb 6, 2021

Adds a button to the QuickReply that allows for toggling of randomize filename.

If a file is present when it is clicked, the filename is randomized. This is destructive, the original filename is not restored if toggled off

image
image

Fixes #473, #1409, #1574, #1573, #1848, #2200, #2660, #2890

Adds a button to the QuickReply that allows for toggling of randomize
filename. If a file is present when it is clicked, the filename is
randomized. This is destructive, the original filename is not restored
if toggled off
@ccd0
Copy link
Owner

ccd0 commented Feb 6, 2021

The filename field is already getting pretty crowded, so it might be better if this button only showed up for people who have the "Randomize Filename" feature enabled. If we do that, the next question is whether the button should be default on/off or have a persistent state separate from the "Randomize Filename" setting. What do you think?

@ccd0
Copy link
Owner

ccd0 commented Feb 6, 2021

Another option would be to move some of the stuff currently in the filename field (much of it having nothing to do with files) somewhere else. But we'd have to think about where.

@paradox460
Copy link
Collaborator Author

paradox460 commented Feb 6, 2021

I could try adding a toolbar down at the bottom below the input controls, and move these elements down into that area. Might be easier to reason about.

As for making it a setting, thats not hard either, would probably be best to make the existing setting just toggle the button's presence/visibility

@saxamaphone69
Copy link
Collaborator

Could the 'Files' button be removed, as clicking 'No selected file' does the same (perhaps #qr-no-file given a title 'Upload file(s) or something)? The min-width of the Quick Reply slightly increased? A new row for 4-5 icons seems excessive, as you'd still want them to be easy to access via keyboard "in order".

IMO, the option in the settings would say "add toggle to QR to randomize filename of files posted" or whatever, and only once that is enabled show the icon (which is enabled). It would then stay enabled until turned off, and would have to be re-enabled next time. I'm sure there is a scenario where someone sets up 10 posts to upload and perhaps wants posts 4 and 6 to be random, but post 5 to be not random, so it would have to accommodate for that. If it's turned off, it does not turn it off in the Settings box - only for that particular post, or if not re-enabled.

@paradox460
Copy link
Collaborator Author

paradox460 commented Feb 6, 2021

A concern of removing the files button is it may impact tabability of file selection. Does tabbing to the file name field provide an upload interface? You cannot tab to the filename field unless it is occupied, meaning you have to have a file already attached. The file button COULD probably be shortened to an icon, say a paperclip or something, but thats only a marginal improvement

Another reason to add a toolbar is to support other options, such as an image reencode like Android apps support (there's a request for enchantment for this) or other things.

I don't feel changing the width is a good solution. The current width fits nicely to the right of the catalog and posts section of the page, and tools and scripts are built with it's size in mind. Make it bigger and you run the risk of breaking them

Finally, moving them to a toolbar may actually improve the keyboard flow. Instead of having to tab over several options to get to post (for users who don't know there's a keyboard shortcut that posts) you have them as auxillary navigation targets. It's not hard to make the tabbing loop around back up to submit

With regards to settings, I'd probably add a "show option to toggle randomizer" independent of the current setting. Users can then have global randomization, toggleable randomization, or no randomization. With it visible, it works as you have requested, or almost so. I can change the randomize current file functionality so that it checks if there are multiple posts, and only randomizes if not, that allows the user to build a dump list and toggle randomization as they build it

Allows the user to control if they want to see the randomize filename
button on their QR. Button appearance is independent of the actual
randomize filename setting

Allows the user to control if they want to see the randomize filename
button on their QR. Button appearance is independent of the actual
randomize filename setting
When toggling the randomize-filename-button, don't rename existing files
if there is a dumplist active. Do rename existing files if only one post
is present
@saxamaphone69
Copy link
Collaborator

Could the input[type="file"] be moved as the first child of #qr-filename-container, and then visually hidden but still tabbable using either this or this?

I'm of the belief that 4chan X is the main extension, and other scripts/styles like OneeChan should adapt to the changes. If 4chan X decides to make the min-width of the QR 350px and not 300, then OneeChan should update to accommodate for that.

@paradox460
Copy link
Collaborator Author

paradox460 commented Feb 7, 2021

Problem with hiding it is you never know who'se workflow you're going to interrupt. Sure, clicking the input works well, but many people may not know that and rely on the file button.

I realize a toolbar would disrupt other people's workflows as well, but it seems like a lower-impact addition. Additionally, boards with meme-flags already have an added dropdown to the bottom of the input, that could easily be condensed down into a button and added to a toolbar
image

@@ -218,7 +218,7 @@ QR =
setRandomizedFilename: (enabled) ->
Conf['Randomize Filename'] = enabled
QR.nodes.randomizedFilename.classList.toggle 'disabled', !enabled
if enabled
Copy link
Owner

Choose a reason for hiding this comment

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

The update on sync probably shouldn't touch the filenames of existing files at all. And a user click should be able to toggle the randomization of a file regardless of whether it's in a dumplist.

@ccd0
Copy link
Owner

ccd0 commented May 8, 2021

This is destructive, the original filename is not restored if toggled off

I think what we really want is a non-destructive version that can restore the original filename if toggled off.

@randoomdude
Copy link

I don't see the randomizer on the quick reply bar anymore, is it still in the latest build?

@paradox460
Copy link
Collaborator Author

@randoomdude was never merged in

@randoomdude
Copy link

@paradox460 Can you just add the script version of it manually then? How do you do that?

@paradox460
Copy link
Collaborator Author

This resolves #3308

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

Successfully merging this pull request may close these issues.

To activate or deactivate the Randomize Filename feature in the QR [request]
4 participants