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

Quick Reblog: Add dialog height option for Quick Tags Integration. #926

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

Conversation

alleycatboy
Copy link
Contributor

Description

This adds an option in Quick Reblog's preferences to increase or decrease the height of the Quick Tags Integration dialog.

This addresses the issue raised in #867.

It parses the the preference from Quick Reblog and sets it as a CSS variable in quickTagsList component. This makes it available on every subsequent render of the Quick Reblog popup dialog without having to check every single time.

The variable changes the height of the dialog from 1 to 20 units, each unit being the height of the button which is the same height as each tag element.

Default (4):
default size

Size 10:
size 10

Size 1:
size 1

Testing steps

To test, go to the Quick Reblog preferences and set a height different than the default of 4. The change should be reflected immediately.

@AprilSylph AprilSylph self-requested a review December 30, 2022 21:49
@@ -340,6 +357,7 @@ export const main = async function () {
$(document.body).on('mouseenter', reblogButtonSelector, showPopupOnHover);

if (quickTagsIntegration) {
setQuickTagsSize(Number.parseInt(quickTagsIntegrationSize));
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would probably move this parseInt call into the rest of the parsing logic, since it seems related.

Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
setQuickTagsSize(Number.parseInt(quickTagsIntegrationSize));
setQuickTagsSize(quickTagsIntegrationSize);

@marcustyphoon marcustyphoon linked an issue Feb 11, 2023 that may be closed by this pull request
Comment on lines +278 to +281
const parseQuickTagsSize = (size) => {
if (!Number.isInteger(size)) {
return 4;
}
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
const parseQuickTagsSize = (size) => {
if (!Number.isInteger(size)) {
return 4;
}
const parseQuickTagsSize = (sizeString) => {
const size = Number.parseInt(sizeString);
if (Number.isNaN(size)) return 4;

@@ -340,6 +357,7 @@ export const main = async function () {
$(document.body).on('mouseenter', reblogButtonSelector, showPopupOnHover);

if (quickTagsIntegration) {
setQuickTagsSize(Number.parseInt(quickTagsIntegrationSize));
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
setQuickTagsSize(Number.parseInt(quickTagsIntegrationSize));
setQuickTagsSize(quickTagsIntegrationSize);

@skircheis
Copy link

This is lovely, but would it be possible to also provide an "expand to fit" option? Say, if the config variable is set to 0, it acts as if set to length(tagBundles).

@marcustyphoon
Copy link
Collaborator

That's pretty much equivalent to removing the maximum value from this PR and the user setting an extremely high number, which may be simpler.

@skircheis
Copy link

skircheis commented May 10, 2023 via email

@marcustyphoon
Copy link
Collaborator

Yep! That's what it does currently.

@skircheis
Copy link

skircheis commented May 10, 2023 via email

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.

Bigger quick tags window
4 participants