* Ensure `updateChargeStatsDisplay` reliably updates charges and full charge display.
* Fix interval handling: clear previous intervals and reset variable to `null`.
* Inline full charge display logic, defaulting to `--:--:--` when not available.
Benefits:
* Charge stats now update consistently without missing ticks.
* Interval management is safer, preventing multiple overlapping timers.
Note:
* Full stats partial update logic is now fully integrated; previous issue of UI flicker or missed updates is resolved.
- Replace `currentCharges` with `displayCharges` for UI representation.
- Introduce `preciseCurrentCharges` to track fractional charge values.
- Update logic in `resetEdgeTracking`, `maybeNotifyChargesReached`, and related functions to use `displayCharges`.
- Modify `updateFullChargeDisplay` to calculate and use `preciseCurrentCharges` and `displayCharges`.
- Refactor `getRemainingMsToThreshold` into `getMsToTargetCharges` for clarity and precision.
- Replace `startChargesThresholdTicker` and `updateChargesThresholdUI` with a unified `updateChargesThresholdUI` function.
- Update HTML templates and dynamic UI updates to reflect `displayCharges`.
Benefits:
- Improves accuracy by distinguishing between displayed and precise charge values.
- Simplifies charge-related logic and reduces redundant calculations.
- Enhances readability and maintainability of charge tracking and UI updates.
Note:
- Ensure all dependent modules correctly handle the new `displayCharges` and `preciseCurrentCharges` fields.
- Introduce conditions to determine whether to call the API based on forced refresh, first check, or elapsed time.
- Add randomization for update intervals between 60s and 90s to stagger API requests.
- Preserve existing behavior of updating charges, cooldown, and max charges when API is called.
- Clear and reset the interval for `updateFullChargeDisplay` only when necessary.
Benefits:
- Reduces server load by avoiding frequent unnecessary API calls.
- Improves efficiency by introducing randomized update intervals.
- Maintains backward compatibility with existing functionality.
Note:
- Ensure `WPlaceService.getCharges()` continues to return valid data under new conditions.
- Replace `wplace-random-batch-input` and `wplace-block-size-input` classes with `wplace-settings-number-input`.
- Update CSS to consolidate styles under `wplace-settings-number-input`.
- Refactor theme variables for background and border colors to use explicit hex values, fixing visibility issue in light theme.
- Remove redundant `.wplace-block-size-input` styles.
Benefits:
- Number inputs are now correctly visible in all themes, including light.
- Reduces duplication in CSS by consolidating input styles.
- Improves consistency across input elements in the UI.
- Enhances clarity of theme variable usage with explicit naming.
Note:
- Ensure all components previously using `wplace-random-batch-input` or `wplace-block-size-input` are tested for visual consistency.
- Replace manual creation of multiple `<link>` elements with `appendLinkOnce` function.
- Add a utility function `appendLinkOnce` to ensure stylesheets are not added multiple times.
- Use `appendLinkOnce` for Font Awesome, Google Fonts, and external CSS links.
- Pass additional attributes (e.g., `data-*`) as an optional parameter to `appendLinkOnce`.
Benefits:
- Prevents potential issues caused by duplicate stylesheets.
- Reduces code duplication for creating and appending `<link>` elements.
- Improves maintainability and readability of the code.
Note:
- All future `<link>` additions should use `appendLinkOnce` to avoid similar bugs.
- Activate CSS variable settings for theming in `Auto-Image.js`.
- Update dropdown class from `wplace-selector` to `wplace-settings-select`.
- Remove inline styles from the "Apply Settings" button.
- Delete obsolete `.wplace-selector` CSS rules from `auto-image-styles.css`.
Benefits:
- Ensures consistent theming across components.
- Simplifies styling management.
- Improves maintainability by removing inline styles.
Note:
- Update dependent components to use the new `wplace-settings-select` class.
- Replace CamelCase animation names with kebab-case (e.g., `slideIn` → `slide-in`).
- Update theme class names to remove double hyphens (e.g., `wp-place-theme--classic` → `wp-place-theme-classic`).
- Standardize color syntax to use modern `rgb()` format with percentage-based alpha values.
- Replace long-form hex colors with shorthand where applicable (e.g., `#ffffff` → `#fff`).
- Simplify redundant or theme-specific styles and consolidate them into single rules.
- Modularize theme-specific styling comments and ensure consistent naming conventions.
- Refactor media queries, gradients, and keyframe animations for improved readability and performance.
- Add missing button hover styles and subtle text shadow for improved contrast.
- Introduce pixel-blinking animation and neon glow effects for the neon theme.
- Optimize slider, shadow, and text variants for consistency and maintainability.
Benefits:
- Improves consistency and readability across CSS and JavaScript files.
- Enhances maintainability by modularizing theme-specific styles and adopting modern syntax.
- Reduces redundancy and file size by eliminating unused or repetitive rules.
- Aligns with modern CSS standards for better compatibility and performance.
Note:
- Ensure all theme files are updated in the `feat-external-lang` branch to avoid broken imports.
- Verify browser compatibility for `rgb` with alpha values and RGB hex alpha syntax if targeting older environments.
- Test for unintended visual changes due to removed CSS variables or consolidated rules.
- Replace old notification toggle structure with a new settings toggle structure for pixel filters.
- Add detailed descriptions for each pixel filter option (white, transparent, unavailable).
- Standardize the styling of toggle titles and descriptions using theme-based colors.
- Introduce a flexbox layout for pixel filter controls to improve spacing and alignment.
- Update language file keys and values for clarity and consistency.
- Add console logs and user alerts for toggle state changes to enhance feedback.
- Ensure toggle states are synchronized with the application state on initialization.
Benefits:
- Improves usability by providing clear descriptions for each option.
- Enhances visual consistency with theme-based styling.
- Simplifies maintenance with a unified toggle structure.
Note:
- Ensure all themes define `text` and `highlight` properties to avoid fallback styling issues.
- Replace `dynamicSleep` implementation with adaptive interval logic.
- Simplify error handling and button state management in `startPainting`.
- Update charges threshold logic to use `dynamicSleep` with inline checks.
- Add early exit for overlay tiles not loaded scenario.
Benefits:
- Reduces unnecessary polling by dynamically adjusting sleep intervals.
- Improves clarity and maintainability of painting flow.
- Ensures proper UI state updates based on stop flag and thresholds.