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

revert some rabbitai damage #8596

Merged
merged 4 commits into from
Oct 24, 2023
Merged

revert some rabbitai damage #8596

merged 4 commits into from
Oct 24, 2023

Conversation

BKSteve
Copy link
Collaborator

@BKSteve BKSteve commented Oct 22, 2023

revert history and inc_qualityChooser mako files so they once again work.

Summary by CodeRabbit

  • Refactor: Simplified the dropdown menu in the history view, making it easier to navigate and understand.
  • Bug Fix: Corrected a syntax error in the history view, ensuring the correct display of dropdown options.
  • New Feature: Enhanced the quality chooser view with automatic selection of user-specific options, improving user experience by reflecting their previous choices.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 22, 2023

Walkthrough

The changes primarily focus on enhancing the user interface by modifying HTML templates. They ensure the correct options are selected in dropdown menus based on certain conditions and values. The changes simplify the code, improve readability, and enhance the overall user experience.

Changes

File Path Summary
.../views/history.mako Replaced a dynamic loop with a hardcoded list of options for a dropdown menu. Each option has a value and a selected attribute based on the limit variable.
.../views/inc_qualityChooser.mako Added the selected="selected" attribute to <option> tags based on certain conditions. This ensures the correct options are selected in the dropdown menus.

🐇💻

"In the land of code, where logic is the road,

Changes small and wide, bring a smoother ride.

Dropdowns now align, with the user's design,

Celebrate this feat, with carrots, oh so sweet!" 🥕🎉


Tips

Chat with CodeRabbit Bot (@coderabbitai)

  • If you reply to a review comment from CodeRabbit, the bot will automatically respond.
  • To engage with CodeRabbit bot directly around the specific lines of code in the PR, mention @coderabbitai in your review comment
  • Note: Review comments are made on code diffs or files, not on the PR overview.
  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai help to get help.

Note: For conversation with the bot, please use the review comments on code diffs or files.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.json

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 0

Commits Files that changed from the base of the PR and between 17f65f3 and a2e6253.
Files selected for processing (2)
  • sickchill/gui/slick/views/history.mako (1 hunks)
  • sickchill/gui/slick/views/inc_qualityChooser.mako (3 hunks)
Files skipped from review due to trivial changes (2)
  • sickchill/gui/slick/views/history.mako
  • sickchill/gui/slick/views/inc_qualityChooser.mako

@BKSteve
Copy link
Collaborator Author

BKSteve commented Oct 22, 2023

@miigotu any way to have coderabbitai not do everything in develop? #8581
I know it's the first go through and is huge, but all are in develop even though not merged in by you.
I can also do modifications to the open pull request and they get propagated into develop without review.
Thus breaking some of your safety protocols.

Then with the above 2 items it's marked them as trivial and skipped. Hmm.

Further: I thought the history one going to a loop was an interesting idea but couldn't find any suitable online references to it. So couldn't work out how to fix it.

@miigotu
Copy link
Contributor

miigotu commented Oct 22, 2023

@miigotu any way to have coderabbitai not do everything in develop? #8581
I know it's the first go through and is huge, but all are in develop even though not merged in by you.
I can also do modifications to the open pull request and they get propagated into develop without review.
Thus breaking some of your safety protocols.

Then with the above 2 items it's marked them as trivial and skipped. Hmm.

Further: I thought the history one going to a loop was an interesting idea but couldn't find any suitable online references to it. So couldn't work out how to fix it.

Coderabbit doesn't make any changes in its own, and I know you can commit right to develop, I gave you those permissions. Nobody else can

@@ -19,7 +19,7 @@ selected = None
<select id="qualityPreset" name="quality_preset" class="form-control input-sm input100" title="qualityPreset">
<option value="0">Custom</option>
% for curPreset in qualityPresets:
<option value="${curPreset}" ${selected(curPreset == overall_quality)} ${('', 'style="padding-left: 15px;"')[qualityPresetStrings[curPreset].endswith("0p")]}>${qualityPresetStrings[curPreset]}</option>
<option value="${curPreset}" ${('', 'selected="selected"')[curPreset == overall_quality]} ${('', 'style="padding-left: 15px;"')[qualityPresetStrings[curPreset].endswith("0p")]}>${qualityPresetStrings[curPreset]}</option>
Copy link
Contributor

@miigotu miigotu Oct 23, 2023

Choose a reason for hiding this comment

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

Here too? Instead of <input ... selected="selected>" the value is now just <input ... selected> which is html5. Can you tell me what the issue is? SickChill needs restarted after the update to this new code, because the selected function is added in the context of the webserver side.

Copy link
Collaborator Author

@BKSteve BKSteve Oct 23, 2023

Choose a reason for hiding this comment

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

Gives a nonetype mako error in the 3 locations

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

File /home/stephenr/PycharmProjects/SickChill/sickchill/views/common.py:87, in render:
return self.template.render_unicode(*args, **context)
File /home/stephenr/.local/lib/python3.10/site-packages/mako/template.py:444, in render_unicode:
return runtime._render(
File /home/stephenr/.local/lib/python3.10/site-packages/mako/runtime.py:874, in _render:
_render_context(
File /home/stephenr/.local/lib/python3.10/site-packages/mako/runtime.py:916, in _render_context:
_exec_template(inherit, lclcontext, args=args, kwargs=kwargs)
File /home/stephenr/.local/lib/python3.10/site-packages/mako/runtime.py:943, in _exec_template:
callable_(context, *args, **kwargs)
File /home/stephenr/PycharmProjects/SickChill/sickchill/gui/slick/views/layouts/main.mako:333, in render_body:
<%block name="content" />
File /home/stephenr/PycharmProjects/SickChill/sickchill/gui/slick/views/editShow.mako:94, in render_content:
<%include file="/inc_qualityChooser.mako" />
File /home/stephenr/.local/lib/python3.10/site-packages/mako/runtime.py:793, in _include_file:
callable_(ctx, **kwargs)
File /home/stephenr/PycharmProjects/SickChill/sickchill/gui/slick/views/inc_qualityChooser.mako:22, in render_body:
${qualityPresetStrings[curPreset]}

TypeError: 'NoneType' object is not callable

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This one's beyond me.

@miigotu
Copy link
Contributor

miigotu commented Oct 23, 2023

I'm confused about this PR, these are all changes I made, they use the selected method I added to the context to avoid having to use indexed tuples that are less readable.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 0
Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between a2e6253 and a392c8b.
Files selected for processing (1)
  • sickchill/gui/slick/views/history.mako (1 hunks)
Files skipped from review due to trivial changes (1)
  • sickchill/gui/slick/views/history.mako

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 0
Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between a392c8b and f9b9675.
Files selected for processing (1)
  • sickchill/gui/slick/views/inc_qualityChooser.mako (1 hunks)
Files skipped from review due to trivial changes (1)
  • sickchill/gui/slick/views/inc_qualityChooser.mako

@miigotu
Copy link
Contributor

miigotu commented Oct 24, 2023

Somehow a selected = None got into the top of the file, thats what happened in inc_quality_chooser.mako

@miigotu miigotu merged commit a697ee1 into develop Oct 24, 2023
11 checks passed
@miigotu miigotu deleted the mako_rabbit branch October 24, 2023 03:01
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.

2 participants