-
Notifications
You must be signed in to change notification settings - Fork 11
fix: Add preset loading functionality for multiple tabs #64
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,6 +26,7 @@ | |
| rel="stylesheet" | ||
| href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css" | ||
| /> | ||
| <script src="presets.js"></script> | ||
| </head> | ||
|
|
||
| <body> | ||
|
|
@@ -99,6 +100,9 @@ <h1 class="text-center animate__animated animate__fadeInDown"> | |
| <button class="add-tab-button" onclick="addFormatterTab()"> | ||
| + Add Tab | ||
| </button> | ||
| <select onchange="loadFormatterPreset(this.value)" class="preset-select"> | ||
| <option value="">-- Load Preset --</option> | ||
| </select> | ||
|
Comment on lines
+103
to
+105
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Add accessibility attributes to preset select elements. The preset select elements lack accessibility attributes, which makes it difficult for screen reader users to understand their purpose. Add -<select onchange="loadFormatterPreset(this.value)" class="preset-select">
+<select onchange="loadFormatterPreset(this.value)" class="preset-select" aria-label="Load formatter preset">
<option value="">-- Load Preset --</option>
</select>-<select onchange="loadComparePreset(this.value)" class="preset-select">
+<select onchange="loadComparePreset(this.value)" class="preset-select" aria-label="Load compare preset">
<option value="">-- Load Preset --</option>
</select>-<select onchange="loadCodegenPreset(this.value)" class="preset-select">
+<select onchange="loadCodegenPreset(this.value)" class="preset-select" aria-label="Load code generator preset">
<option value="">-- Load Preset --</option>
</select>Also applies to: 118-120, 133-135 🤖 Prompt for AI Agents |
||
| </div> | ||
| <div id="formatter-tab-contents"> | ||
| <!-- Formatter tab contents will be dynamically added here --> | ||
|
|
@@ -111,6 +115,9 @@ <h1 class="text-center animate__animated animate__fadeInDown"> | |
| <button class="add-tab-button" onclick="addCompareTab()"> | ||
| + Add Tab | ||
| </button> | ||
| <select onchange="loadComparePreset(this.value)" class="preset-select"> | ||
| <option value="">-- Load Preset --</option> | ||
| </select> | ||
| </div> | ||
| <div id="compare-tab-contents"> | ||
| <!-- Compare tab contents will be dynamically added here --> | ||
|
|
@@ -123,6 +130,9 @@ <h1 class="text-center animate__animated animate__fadeInDown"> | |
| <button class="add-tab-button" onclick="addCodegenTab()"> | ||
| + Add Tab | ||
| </button> | ||
| <select onchange="loadCodegenPreset(this.value)" class="preset-select"> | ||
| <option value="">-- Load Preset --</option> | ||
| </select> | ||
| </div> | ||
| <div id="codegen-tab-contents"> | ||
| <!-- CodeGen tab contents will be dynamically added here --> | ||
|
|
||
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.
CSS variables are undefined and may cause styling issues.
The
.preset-selectclass uses CSS variables (--border-color,--bg-color,--text-color,--primary-color,--primary-color-light) that are not defined anywhere in the CSS file. This will cause the styles to fall back to browser defaults.Additionally, this introduces inconsistency as the rest of the CSS file uses hardcoded color values (e.g.,
#007bfffor primary color).Consider either:
.preset-select { margin-left: 10px; padding: 5px 10px; - border: 1px solid var(--border-color); + border: 1px solid #ccc; border-radius: 4px; - background-color: var(--bg-color); - color: var(--text-color); + background-color: #ffffff; + color: #333; font-size: 14px; cursor: pointer; transition: border-color 0.2s; } .preset-select:hover { - border-color: var(--primary-color); + border-color: #007bff; } .preset-select:focus { outline: none; - border-color: var(--primary-color); - box-shadow: 0 0 0 2px var(--primary-color-light); + border-color: #007bff; + box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.2); }🤖 Prompt for AI Agents