Skip to content

Add pixel based details/caption offset#1580

Merged
extesy merged 3 commits intoextesy:masterfrom
LiliaDoe:Fix-details/caption-offset
Mar 21, 2025
Merged

Add pixel based details/caption offset#1580
extesy merged 3 commits intoextesy:masterfrom
LiliaDoe:Fix-details/caption-offset

Conversation

@LiliaDoe
Copy link
Copy Markdown
Contributor

@LiliaDoe LiliaDoe commented Mar 21, 2025

  • Adds pixel based offset
  • Adds the ability to switch between pixel and percentage based
  • Clarifies some of the offset options text
  • Allows the caption/detail text to be moved below the image

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Hello @LiliaDoe, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

Summary of Changes

This pull request by LiliaDoe introduces the ability to specify the offset of details/captions in either pixels or percentages. It modifies the options page to include a dropdown to select the unit type (pixels or percentage) for both above and below position offsets. The changes also include updates to the locale file to add new messages and tooltips related to the new unit type options, and updates to the javascript files to handle the new options.

Highlights

  • New Feature: Adds pixel-based offset functionality for details/captions.
  • UI Enhancement: Introduces a dropdown to switch between pixel and percentage-based offsets in the options menu.
  • Code Modification: Updates JavaScript code to apply pixel or percentage-based offsets based on user selection.

Changelog

Click here to see the changelog
  • _locales/en/messages.json
    • Added new messages and tooltips for pixel/percentage offset unit selection.
    • Clarified existing offset option text.
  • html/options.html
    • Added dropdowns to select the unit type (pixel or percentage) for above and below position offsets.
    • Adjusted input field widths for better layout.
  • js/common.js
    • Added default values for 'belowPositionOffsetUnit' and 'abovePositionOffsetUnit' to 'percent'.
  • js/hoverzoom.js
    • Modified the code to apply offsets based on the selected unit type (pixel or percentage).
    • Adjusted the way the top and bottom css properties are set based on the unit type.
  • js/options.js
    • Modified saveOptions function to save the selected unit types for above and below position offsets.
    • Modified restoreOptions function to restore the selected unit types from the options.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.


Did you know?

The first digital camera was created in 1975 by Steven Sasson, an engineer at Eastman Kodak. It weighed 3.75 pounds and recorded black and white images onto a cassette tape.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

The pull request introduces pixel-based offset functionality and allows switching between pixel and percentage-based offsets. The changes are well-structured and address the intended functionality. However, there are a few areas that could be improved to enhance the code's robustness and maintainability.

Summary of Findings

  • Missing input validation: The code lacks input validation for the offset values. This could lead to unexpected behavior or errors if the user enters invalid data (e.g., non-numeric values, values outside the allowed range). I did not comment on this issue due to the review settings.
  • Lack of error handling: The code does not include error handling for potential issues such as failed attempts to save or restore options. This could make it difficult to diagnose and resolve problems. I did not comment on this issue due to the review settings.

Merge Readiness

The pull request is not yet ready for merging. While the core functionality is implemented, the lack of input validation and error handling could lead to issues in production. I recommend addressing the identified issues before merging. I am unable to directly approve this pull request, and users should have others review and approve this code before merging.

Comment thread _locales/en/messages.json
Comment thread _locales/en/messages.json Outdated
@sonarqubecloud
Copy link
Copy Markdown

@extesy extesy merged commit a54e23a into extesy:master Mar 21, 2025
3 checks passed
@LiliaDoe LiliaDoe deleted the Fix-details/caption-offset branch March 21, 2025 23:52
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