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

feat(ext.pages): Add use_styled_buttons #1811

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

Conversation

Nzii3
Copy link
Contributor

@Nzii3 Nzii3 commented Nov 30, 2022

Summary

Adds use_styled_buttons in ext.pages.Paginator which essentially styles buttons with emojis by using a single parameter. Overwrites use_default_buttons when used in the Paginator __init__.

Information

  • This PR fixes an issue.
  • This PR adds something new (e.g. new method or parameters).
  • This PR is a breaking change (e.g. methods or parameters removed/renamed).
  • This PR is not a code change (e.g. documentation, README, typehinting,
    examples, ...).

Checklist

  • I have searched the open pull requests for duplicates.
  • If code changes were made then they have been tested.
    • I have updated the documentation to reflect the changes.
  • If type: ignore comments were used, a comment is also left explaining why.

@Nzii3 Nzii3 requested a review from a team as a code owner November 30, 2022 00:20
@Nzii3 Nzii3 changed the title Add use_styled_buttons ext.pages: Add use_styled_buttons Nov 30, 2022
@Nzii3 Nzii3 self-assigned this Nov 30, 2022
@Nzii3 Nzii3 added the ext.pages Relating to ext.pages label Nov 30, 2022
@Nzii3
Copy link
Contributor Author

Nzii3 commented Nov 30, 2022

Example code:

from discord.ext.pages import Paginator
pages = ['1', '2', '3']
paginator = Paginator(pages=pages, use_styled_buttons=True)
await paginator.respond(ctx)

Output:
image

@Nzii3 Nzii3 changed the title ext.pages: Add use_styled_buttons feat(ext.pages): Add use_styled_buttons Nov 30, 2022
@Lulalaby
Copy link
Member

I like how the ci fails again

@Lulalaby Lulalaby enabled auto-merge (squash) November 30, 2022 00:47
@Nzii3
Copy link
Contributor Author

Nzii3 commented Nov 30, 2022

I like how the ci fails again

@Lulalaby it doesn’t like me :/

discord/ext/pages/pagination.py Outdated Show resolved Hide resolved
discord/ext/pages/pagination.py Outdated Show resolved Hide resolved
discord/ext/pages/pagination.py Outdated Show resolved Hide resolved
@Lulalaby
Copy link
Member

No worries. Is fixed. Please address the requested changes.

auto-merge was automatically disabled November 30, 2022 01:09

Head branch was pushed to by a user without write access

@Nzii3
Copy link
Contributor Author

Nzii3 commented Nov 30, 2022

Added changes 👍

@Lulalaby Lulalaby enabled auto-merge (squash) November 30, 2022 01:30
Lulalaby
Lulalaby previously approved these changes Nov 30, 2022
@Lulalaby
Copy link
Member

I don't even question anymore how you've managed to let the ci fail two more times just by applying the string changes

@BobDotCom
Copy link
Member

I don't even question anymore how you've managed to let the ci fail two more times just by applying the string changes

CI sometimes fails when a new build is triggered while the previous isn't finished

Copy link
Member

@BobDotCom BobDotCom left a comment

Choose a reason for hiding this comment

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

In addition to the other comments, please add a changelog entry for both the new params and new method.

discord/ext/pages/pagination.py Show resolved Hide resolved
discord/ext/pages/pagination.py Show resolved Hide resolved
discord/ext/pages/pagination.py Show resolved Hide resolved
discord/ext/pages/pagination.py Outdated Show resolved Hide resolved
auto-merge was automatically disabled December 1, 2022 05:03

Head branch was pushed to by a user without write access

@Nzii3
Copy link
Contributor Author

Nzii3 commented Dec 1, 2022

In addition to the other comments, please add a changelog entry for both the new params and new method.

Done.

Copy link
Member

@BobDotCom BobDotCom left a comment

Choose a reason for hiding this comment

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

After testing, I found that the style is highly inconsistent on MacOS. I've included examples from both before and after my suggested changes.

Before: System emoji is used for both the first and last buttons. The "next" button appears fine, but the "prev" button is oversized and the bottom of the character is clipped off.
Screen Shot 2022-12-03 at 12 56 38 PM

After: There is a blue outline on the emojis, but full parity is achieved between each emoji and between all operating systems as the discord emoji set is used.
Screen Shot 2022-12-03 at 1 00 25 PM

discord/ext/pages/pagination.py Outdated Show resolved Hide resolved
discord/ext/pages/pagination.py Outdated Show resolved Hide resolved
discord/ext/pages/pagination.py Outdated Show resolved Hide resolved
discord/ext/pages/pagination.py Outdated Show resolved Hide resolved
@Nzii3
Copy link
Contributor Author

Nzii3 commented Dec 6, 2022

Should I add #1818 into this pr for v2.4?

@Lulalaby
Copy link
Member

Lulalaby commented Dec 6, 2022

Should I add #1818 into this pr for v2.4?

Personally I would prefer this

@pullapprove4
Copy link

pullapprove4 bot commented Jul 27, 2023

Please add a changelog entry

@Lulalaby Lulalaby added this to the v2.6 milestone Feb 28, 2024
@Dorukyum Dorukyum removed the on hold label Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ext.pages Relating to ext.pages priority: low Low Priority
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

None yet

5 participants