-
Notifications
You must be signed in to change notification settings - Fork 0
Feature/tailwind css #4
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
Conversation
…lwind CSS feat: refactor app.js to improve view management and loading indicators feat: update image-canvas.js to enhance bounding box styling for better visibility
Summary of ChangesHello @cs-util, 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! This pull request delivers a comprehensive refactoring of the application's user interface, transitioning from Pico.css to Tailwind CSS to achieve a more polished and consistent visual design. The changes enhance the overall user experience by improving the styling of key components, boosting accessibility features, and streamlining the underlying code for managing view states. Highlights
Using Gemini Code AssistThe 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 by creating a comment using either
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 Limitations & Feedback Gemini Code Assist 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. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. 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. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request is a great improvement, successfully refactoring the UI to use Tailwind CSS for a more modern and consistent design. The code structure is also cleaner, especially with the new setViewVisibility helper method. My review focuses on a few minor opportunities to remove redundant code and classes left over from the refactoring, which will enhance the overall maintainability of the codebase.
|
|
||
| <div id="views"> | ||
| <div id="views" class="space-y-8 px-4 pb-12"> | ||
| <section id="camera-view" class="view is-active" aria-labelledby="camera-tab"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The is-active class on this section appears to be a leftover from the previous CSS implementation and is no longer used for styling with Tailwind CSS. The view's visibility is now determined by the presence or absence of the hidden class. Removing this unused class will make the markup cleaner.
| <section id="camera-view" class="view is-active" aria-labelledby="camera-tab"> | |
| <section id="camera-view" class="view" aria-labelledby="camera-tab"> |
| <a href="pages/about.html" id="about-link" class="inline-flex items-center justify-center rounded-full border border-slate-200 bg-white px-4 py-2 text-sm font-semibold text-slate-700 transition hover:bg-slate-100 focus:outline-none focus-visible:ring-2 focus-visible:ring-emerald-400 focus-visible:ring-offset-2">About & disclaimers</a> | ||
| </div> | ||
| <pre id="logs" class="logs" hidden></pre> | ||
| <pre id="logs" class="hidden whitespace-pre-wrap rounded-2xl bg-slate-900 p-4 text-xs font-mono text-slate-100" hidden></pre> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The <pre> element for logs has both a hidden class from Tailwind and a hidden boolean attribute. Since the element's visibility is controlled in JavaScript by toggling the hidden attribute, the hidden class is redundant. Relying on a single method for controlling visibility will make the code easier to maintain.
| <pre id="logs" class="hidden whitespace-pre-wrap rounded-2xl bg-slate-900 p-4 text-xs font-mono text-slate-100" hidden></pre> | |
| <pre id="logs" class="whitespace-pre-wrap rounded-2xl bg-slate-900 p-4 text-xs font-mono text-slate-100" hidden></pre> |
| const isActive = button.dataset.tab === activeTab; | ||
| button.setAttribute('aria-current', isActive ? 'page' : 'false'); | ||
| button.classList.toggle('text-emerald-600', isActive); | ||
| button.classList.toggle('border-emerald-500', isActive); | ||
| button.classList.toggle('text-slate-500', !isActive); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The is-active class is toggled here, but it seems to be a leftover from the pre-Tailwind CSS implementation and is no longer used for styling. Visibility is now handled by the hidden class. Removing the logic for is-active will simplify this method. You should also remove the is-active class from the #camera-view section in index.html for consistency.
setViewVisibility(section, isActive) {
if (!section) return;
section.classList.toggle('hidden', !isActive);
}| }); | ||
| this.switchView(activeTab); | ||
| if (state.estimation.data) { | ||
| this.elements.views.result.classList.add('is-active'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting
| <div class="flex flex-wrap items-center gap-3"> | ||
| <button id="logs-toggle" type="button" class="inline-flex items-center justify-center rounded-full border border-slate-200 bg-white px-4 py-2 text-sm font-semibold text-slate-700 transition hover:bg-slate-100 focus:outline-none focus-visible:ring-2 focus-visible:ring-emerald-400 focus-visible:ring-offset-2">Show logs</button> | ||
| <button id="wipe-data" class="secondary inline-flex items-center justify-center rounded-full border border-red-200 bg-red-50 px-4 py-2 text-sm font-semibold text-red-600 transition hover:bg-red-100 focus:outline-none focus-visible:ring-2 focus-visible:ring-red-400 focus-visible:ring-offset-2" type="button">Wipe all data</button> | ||
| <a href="pages/about.html" id="about-link" class="inline-flex items-center justify-center rounded-full border border-slate-200 bg-white px-4 py-2 text-sm font-semibold text-slate-700 transition hover:bg-slate-100 focus:outline-none focus-visible:ring-2 focus-visible:ring-emerald-400 focus-visible:ring-offset-2">About & disclaimers</a> | ||
| </div> | ||
| <pre id="logs" class="logs" hidden></pre> | ||
| <pre id="logs" class="hidden whitespace-pre-wrap rounded-2xl bg-slate-900 p-4 text-xs font-mono text-slate-100" hidden></pre> | ||
| </article> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[P1] Logs toggle no longer shows output
The logs <pre> now carries the Tailwind hidden class in addition to the hidden attribute. The click handler in App only flips the hidden property (this.elements.logs.hidden = !this.elements.logs.hidden), so even after toggling the attribute off the hidden class still keeps the element display: none. As a result the “Show logs” button can never reveal the logs panel. Drop the hidden class or update the JS to remove it when showing the logs.
Useful? React with 👍 / 👎.
…te file input handling in tests
…e Blob handling; add test for history entries retaining Blob thumbnails
…parsing logic to support legacy width/height format
…ameter in catch block
This pull request refactors and improves the UI styling and accessibility of several components in the application. The changes focus on enhancing the visual appearance, consistency, and accessibility of interactive elements, status indicators, and content sections. The most important changes are grouped below:
UI Component and Styling Enhancements:
renderEditableItems, including improved borders, rounded corners, spacing, and button designs for better visual clarity and usability.Accessibility Improvements:
Code Structure and Consistency:
setViewVisibilitymethod to consistently manage active and hidden states for view sections, replacing repetitive class toggling logic. [1] [2]ImageCanvaswith improved styling for better visibility and consistency.