Skip to content

feat: responsive SWAL#2222

Merged
limetech merged 11 commits into
masterfrom
feat/swal-responsive
Jun 8, 2025
Merged

feat: responsive SWAL#2222
limetech merged 11 commits into
masterfrom
feat/swal-responsive

Conversation

@zackspear

@zackspear zackspear commented May 31, 2025

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Refactor
    • Updated the SweetAlert integration with a refreshed version, maintaining the same user-facing functionality.
    • Modernized and restructured the SweetAlert CSS for improved layout, animations, and visual consistency.
  • Style
    • Removed custom styles targeting SweetAlert buttons from general stylesheets, ensuring SweetAlert elements use their dedicated styles.
    • Enhanced and clarified the appearance of SweetAlert dialogs, icons, buttons, and animations for a more polished look across devices.

@coderabbitai

coderabbitai Bot commented May 31, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

The changes update the SweetAlert JavaScript integration with a refreshed, functionally equivalent version of the library and extensively refactor its CSS. The .sweet-alert button selector is removed from global style rules, and SweetAlert's CSS is modernized using flexbox, improved animations, and more structured styling. No new features or API changes are introduced.

Changes

File(s) Change Summary
emhttp/plugins/dynamix/javascript/dynamix.js Replaced embedded SweetAlert v1.0.0 code with a refreshed, functionally equivalent version.
emhttp/plugins/dynamix/sheets/ArrayOperation.css Removed .sweet-alert button from margin reset selector for mobile/tablet viewports.
emhttp/plugins/dynamix/styles/default-base.css Removed .sweet-alert button from grouped button/input style rules throughout the file.
emhttp/plugins/dynamix/styles/jquery.sweetalert.css Completely refactored and modernized SweetAlert CSS with flexbox, new animations, and structured selectors.

Suggested labels

7.2

Poem

In the warren, code gets neat,
SweetAlert’s style hops to a modern beat.
Buttons trimmed, selectors pruned,
Animations swirl—how sweetly tuned!
With CSS refactored and scripts refreshed,
The UI garden is newly enmeshed.
🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 610cfee and 9cb626e.

📒 Files selected for processing (1)
  • emhttp/plugins/dynamix/styles/jquery.sweetalert.css (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • emhttp/plugins/dynamix/styles/jquery.sweetalert.css
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Analyze (javascript-typescript)

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • 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/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Base automatically changed from feat/array-operation-responsive to master May 31, 2025 15:44

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 5

🧹 Nitpick comments (3)
emhttp/plugins/dynamix/javascript/dynamix.js (1)

51-51: jQuery Cookie plugin update looks good, but consider modern alternatives

The jQuery Cookie plugin has been properly updated with SameSite support defaulting to 'Lax', which is good for security. However, the minified code makes detailed review difficult.

Consider these modern alternatives:

  1. Use the native document.cookie API with proper SameSite handling
  2. Migrate to a more modern cookie library that doesn't depend on jQuery
  3. Use the Web Storage API (localStorage/sessionStorage) where appropriate
// Modern cookie handling example without jQuery dependency
function setCookie(name, value, options = {}) {
  const defaults = { path: '/', sameSite: 'Lax' };
  const config = { ...defaults, ...options };
  
  let cookieString = `${encodeURIComponent(name)}=${encodeURIComponent(value)}`;
  
  if (config.expires) {
    cookieString += `; expires=${config.expires.toUTCString()}`;
  }
  if (config.path) {
    cookieString += `; path=${config.path}`;
  }
  if (config.sameSite) {
    cookieString += `; sameSite=${config.sameSite}`;
  }
  
  document.cookie = cookieString;
}
emhttp/plugins/dynamix/styles/jquery.sweetalert.css (2)

27-33: Add fallback generic fonts
Using font-family: clear-sans; without a generic family can lead to unexpected fallbacks. It’s best practice to include a fallback:

-  font-family: clear-sans;
+  font-family: clear-sans, sans-serif;

459-483: Remove duplicate typography rules
You define .sweet-alert h2 and p styles twice—once via nesting (which is invalid) and again as flat selectors. After flattening the nested rules, remove one of these blocks to avoid redundancy and potential style conflicts.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 15b374d and 58c2038.

📒 Files selected for processing (4)
  • emhttp/plugins/dynamix/javascript/dynamix.js (1 hunks)
  • emhttp/plugins/dynamix/sheets/ArrayOperation.css (1 hunks)
  • emhttp/plugins/dynamix/styles/default-base.css (10 hunks)
  • emhttp/plugins/dynamix/styles/jquery.sweetalert.css (1 hunks)
🧰 Additional context used
🪛 Biome (1.9.4)
emhttp/plugins/dynamix/styles/jquery.sweetalert.css

[error] 94-94: Unknown property is not allowed.

See CSS Specifications and browser specific properties for more details.
To resolve this issue, replace the unknown property with a valid CSS property.

(lint/correctness/noUnknownProperty)


[error] 100-100: Unknown property is not allowed.

See CSS Specifications and browser specific properties for more details.
To resolve this issue, replace the unknown property with a valid CSS property.

(lint/correctness/noUnknownProperty)


[error] 501-501: Unknown property is not allowed.

See CSS Specifications and browser specific properties for more details.
To resolve this issue, replace the unknown property with a valid CSS property.

(lint/correctness/noUnknownProperty)


[error] 508-508: Unknown property is not allowed.

See CSS Specifications and browser specific properties for more details.
To resolve this issue, replace the unknown property with a valid CSS property.

(lint/correctness/noUnknownProperty)

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (11)
emhttp/plugins/dynamix/sheets/ArrayOperation.css (1)

48-55: Approve: Exclude SweetAlert buttons from responsive table margin reset
Removing .sweet-alert button ensures SweetAlert dialogs keep their own styling without being affected by the table’s button margin rules.

emhttp/plugins/dynamix/styles/default-base.css (10)

172-178: Approve: Exclude SweetAlert buttons from base button typography styles
Removing .sweet-alert button prevents SweetAlert buttons from inheriting the general button font settings, keeping their dedicated styles intact.


210-217: Approve: Remove SweetAlert buttons from no-margin button group
Excluding .sweet-alert button from the .buttons-no-margin rules avoids unintended margin resets on alert buttons.


231-237: Approve: Add focus styling for textarea elements
Including textarea:focus alongside input focus ensures consistent focus visuals across form controls.


241-246: Approve: Extend hover effect to a.button links
Adding a.button:hover aligns link-styled buttons with the same hover feedback as native buttons.


257-267: Approve: Include a.button:active[disabled] in disabled state
Ensures disabled link-buttons mirror the opacity and cursor behavior of disabled inputs and buttons.


2085-2091: Approve: Exclude SweetAlert buttons from sidebar base styles
Removing .sweet-alert button here keeps the sidebar’s button styles scoped to its own controls.


2102-2108: Approve: Add textarea:focus override in sidebar theme
This addition ensures text areas in the sidebar receive the same focus treatment as inputs.


2114-2119: Approve: Include a.button:hover in sidebar hover styles
Consistent hover states for link-styled buttons enhance UI coherence in the sidebar.


2126-2131: Approve: Add a.button:active in sidebar active state
Provides visual feedback for active link-buttons within the sidebar layout.


2136-2148: Approve: Include textarea[disabled] in sidebar disabled styles
Ensures disabled text areas in the sidebar adopt the intended disabled appearance.

Comment thread emhttp/plugins/dynamix/javascript/dynamix.js
Comment thread emhttp/plugins/dynamix/javascript/dynamix.js
Comment thread emhttp/plugins/dynamix/styles/jquery.sweetalert.css Outdated
Comment thread emhttp/plugins/dynamix/styles/jquery.sweetalert.css Outdated
Comment thread emhttp/plugins/dynamix/styles/jquery.sweetalert.css

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 3

♻️ Duplicate comments (2)
emhttp/plugins/dynamix/styles/jquery.sweetalert.css (2)

27-407: Fix SASS-style nesting: nested rules invalid in plain CSS
The entire .sweet-alert block (lines 27–407) uses nested selectors (e.g., h2 {…}, &.show {…}, &::before, etc.), which are not supported in vanilla CSS. Browsers will ignore these nested rules, causing many styles to be lost. You should either:

  • Convert this file to a CSS preprocessor format (e.g., rename to .scss and include in your build), or
  • Flatten all nested selectors into valid CSS, for example:
.sweet-alert h2 { … }
.sweet-alert .sa-error-container.show { … }
.sweet-alert .sa-input-error::before { … }

409-456: Fix nested selectors in .sweet-alert.nchan block
Within the .sweet-alert.nchan rules (lines 410–456), nested blocks like h2 {…}, pre { h2 {…} p {…} }, and p {…} are invalid in plain CSS. Flatten these to valid selectors, for example:

.sweet-alert.nchan h2 { … }
.sweet-alert.nchan pre h2 { … }
.sweet-alert.nchan pre p { … }
🧹 Nitpick comments (7)
emhttp/plugins/dynamix/javascript/dynamix.js (1)

50-51: Normalize cookie SameSite attribute casing.

The jQuery Cookie plugin emits ; samesite=…, but the standard attribute name is SameSite. For clarity and consistency, update it as follows:

- "; samesite="+o.samesite
+ "; SameSite="+o.samesite

Optionally, consider defaulting HttpOnly if the cookies are meant to be inaccessible from JavaScript.

emhttp/plugins/dynamix/styles/jquery.sweetalert.css (6)

458-484: Remove duplicate typography definitions
Heading and paragraph styles are declared both nested inside .sweet-alert (lines 49–60, 62–73) and again flattened (lines 458–484). After you flatten nested rules, remove one of these duplicate blocks to avoid redundancy.


85-102: Consolidate .sa-error-container styles
The .sa-error-container block is defined nested (lines 85–102) and then again in flat form later (lines 492–510). Flatten your nested rules into the flat definitions and remove the duplicated section.


121-164: Consolidate .sa-input-error styles
.sa-input-error appears as a nested block (lines 121–164) and also as flat selectors (lines 528–572). Keep only the flat definitions once you’ve flattened all rules.


166-192: Consolidate input field styles
Input-related selectors (input[type=text], focus, placeholder) are defined both nested (lines 166–192) and flat (lines 573–604). After flattening, remove the nested duplicates to streamline the file.


199-202: Consolidate .show-input styles
The .show-input rules are declared nested (lines 199–202) and again flattened (lines 606–608). Retain only the flat definition post-flattening.


203-219: Consolidate loading spinner rules
The .la-ball-fall spinner is defined nested within .sweet-alert (lines 203–219) and again flat under .sweet-alert .la-ball-fall (lines 642–656). Flatten nested rules into the flat block and remove the duplicate.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 15b374d and 0244398.

📒 Files selected for processing (4)
  • emhttp/plugins/dynamix/javascript/dynamix.js (1 hunks)
  • emhttp/plugins/dynamix/sheets/ArrayOperation.css (1 hunks)
  • emhttp/plugins/dynamix/styles/default-base.css (10 hunks)
  • emhttp/plugins/dynamix/styles/jquery.sweetalert.css (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (12)
emhttp/plugins/dynamix/sheets/ArrayOperation.css (1)

48-55: Removed .sweet-alert button selector from responsive margin reset
Decouples SweetAlert-specific button styling from the generic responsive table layout. Ensure margin rules for SweetAlert buttons have been migrated to its dedicated stylesheet.

emhttp/plugins/dynamix/styles/default-base.css (10)

172-177: Removed .sweet-alert button from global control styling
This extraction focuses generic button styles on standard controls and centralizes SweetAlert button styles in its own CSS.


210-215: Excluded .sweet-alert button from .buttons-no-margin, .buttons-spaced group
Good separation of concerns. Confirm SweetAlert button margin behavior is managed by its dedicated CSS.


236-242: Added textarea:focus to the focus state group
Ensures textareas receive the same focus background and outline behavior as text inputs.


241-246: Removed SweetAlert from hover state selectors
Decouples SweetAlert hover styles; verify that its dedicated stylesheet provides the expected hover effects.


270-272: Removed SweetAlert from active/disabled state selectors
Centralizes active and disabled state styling for SweetAlert buttons in its own CSS.


2085-2090: Removed .sweet-alert button from sidebar button group
Consistent with the global removal; please confirm that the SweetAlert CSS covers sidebar modal buttons as well.


2102-2108: Included textarea:focus in sidebar focus styling
Maintains consistent focus treatments for all form controls in the sidebar.


2114-2119: Removed SweetAlert from sidebar hover selectors
Ensure the SweetAlert stylesheet provides hover feedback within sidebar-themed dialogs.


2126-2131: Removed SweetAlert from sidebar active selectors
Active state styling should now be handled exclusively by SweetAlert's own CSS.


2136-2148: Removed SweetAlert from sidebar disabled selectors and added textarea[disabled]
Decouples default disabled styling and extends it to textareas. Verify that disabled SweetAlert buttons still render correctly.

emhttp/plugins/dynamix/javascript/dynamix.js (1)

47-49:

Details

❓ Verification inconclusive

Verify embedded SweetAlert version and audit for vulnerabilities.

You’ve refreshed the embedded SweetAlert block (still labeled v1.0.0) but it remains minified, which prevents security scanners and static analysis from flagging known issues. Please confirm:

  1. That this code exactly matches the intended official release (v1.0.0) and no unintended mix of versions occurred.
  2. Whether any patches from later v1.x releases (e.g., v1.1.3+) are missing.
  3. That regression testing covers all API paths (string vs. object arguments, AMD/CommonJS exports, input handling, etc.).

You can run a quick check against the npm registry and known advisories:


🏁 Script executed:

#!/bin/bash
# Verify SweetAlert 1.x versions and check for advisories
echo "Available SweetAlert v1.x versions:"
curl -s https://registry.npmjs.org/sweetalert | jq '.versions | keys[]' | grep '"1\.' | sort -V

echo "Checking npm audit for SweetAlert:"
npm audit --package-lock-only --json \
  | jq '.advisories | to_entries[] | select(.value.module_name=="sweetalert")'

Length of output: 833


Action Required: Diff embedded SweetAlert vs. official v1.0.0/1.1.3 and audit

  • Available v1.x releases on npm:
    1.0.0, 1.0.0-beta, 1.0.1, 1.1.0, 1.1.1, 1.1.2, 1.1.3
  • npm audit couldn’t run without a lockfile, so no advisories surfaced.

Please verify the following:

• Confirm the block in emhttp/plugins/dynamix/javascript/dynamix.js (after the Bergware header) exactly matches the official dist/sweetalert.min.js from sweetalert@1.0.0.
• Extract and diff the same file from sweetalert@1.1.3—ensure you’re not missing any security patches in later v1.x releases.
• Add a package-lock.json, rerun npm audit --json | jq '.advisories' to catch any known issues.
• Validate regression tests cover all SweetAlert API paths:
– String vs. object invocation
– AMD/CommonJS exports
– Input/prompt handling, loader behavior, escape-key and outside-click options

Comment thread emhttp/plugins/dynamix/styles/jquery.sweetalert.css
Comment thread emhttp/plugins/dynamix/styles/jquery.sweetalert.css
Comment thread emhttp/plugins/dynamix/styles/jquery.sweetalert.css
@zackspear zackspear marked this pull request as ready for review June 2, 2025 21:56
@zackspear zackspear requested a review from ljm42 June 2, 2025 22:59
@ljm42 ljm42 added the 7.2 label Jun 3, 2025
@limetech limetech merged commit fb3675b into master Jun 8, 2025
3 checks passed
@limetech limetech deleted the feat/swal-responsive branch June 8, 2025 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants