Skip to content

merge master into dev - #92

Merged
camoloqlo merged 78 commits into
devfrom
master
Oct 7, 2025
Merged

camoloqlo merged 78 commits into
devfrom
master

Conversation

@camoloqlo

Copy link
Copy Markdown
Owner

This pull request introduces several improvements to the profile priority list system and enhances the PriorityListView component, especially around drag-and-drop usability and styling. The most significant changes include a refactor of how priority lists are registered and initialized, improved default handling when loading profiles, and a much smoother drag-and-drop experience with auto-scroll and CSS-based styling.

Profile Priority List Refactoring and Initialization:

  • Introduced a new registerPriorityList method in AbstractProfileController to associate each PriorityListView with both its configuration key and enum class, simplifying setup and making future extensions easier. (wos-hmi/src/main/java/cl/camodev/wosbot/common/view/AbstractProfileController.java)
  • Changed the profile loading logic to reinitialize priority lists with default enum values if no saved configuration exists, ensuring lists always show valid defaults. (wos-hmi/src/main/java/cl/camodev/wosbot/common/view/AbstractProfileController.java) [1] [2]
  • Removed the need for each controller (e.g., AllianceShopController) to handle its own priority list initialization and merging, centralizing this logic in the abstract controller. (wos-hmi/src/main/java/cl/camodev/wosbot/alliance/view/AllianceShopController.java)

Drag-and-Drop and Auto-Scroll Enhancements:

  • Added auto-scroll functionality to PriorityListView during drag-and-drop operations, making it easier to reorder items in long lists. Scroll speed is proportional to proximity to the list's edges, and the scroll bar is smoothly controlled via an AnimationTimer. (wos-hmi/src/main/java/cl/camodev/wosbot/common/view/PriorityListView.java) [1] [2] [3] [4]
  • Improved drag-and-drop feedback by using CSS classes for visual cues (e.g., border highlights), replacing inline styles for better maintainability and theming. (wos-hmi/src/main/java/cl/camodev/wosbot/common/view/PriorityListView.java) [1] [2]

Styling and Code Quality:

  • Switched from inline styles to CSS classes for both the list view and its cells, making it easier to maintain and update the application's appearance. (wos-hmi/src/main/java/cl/camodev/wosbot/common/view/PriorityListView.java) [1] [2]
  • Minor code cleanups, such as using Comparator.comparingInt and removing redundant code in drag-and-drop logic. (wos-hmi/src/main/java/cl/camodev/wosbot/common/view/PriorityListView.java) [1] [2]

These changes collectively make the priority list system more robust, user-friendly, and maintainable.

# Conflicts:
#	wos-ot/src/main/java/cl/camodev/wosbot/console/enumerable/EnumTemplates.java
#	wos-serv/src/main/java/cl/camodev/wosbot/serv/task/DelayedTask.java
#	wos-serv/src/main/java/cl/camodev/wosbot/serv/task/impl/JourneyofLightTask.java
#	wos-serv/src/main/java/cl/camodev/wosbot/serv/task/impl/PolarTerrorHuntingTask.java
# Conflicts:
#	wos-ot/src/main/java/cl/camodev/wosbot/console/enumerable/EnumTemplates.java
#	wos-serv/src/main/java/cl/camodev/wosbot/serv/task/DelayedTask.java
#	wos-serv/src/main/java/cl/camodev/wosbot/serv/task/impl/PolarTerrorHuntingTask.java
# Conflicts:
#	wos-serv/src/main/java/cl/camodev/wosbot/serv/task/impl/IntelligenceTask.java
# Conflicts:
#	wos-utiles/src/main/java/cl/camodev/utiles/UtilOCR.java
neptune-dev-23 and others added 23 commits October 4, 2025 14:31
Also clean some unused imports and dead/redundant code
… is inactive

- Add UtilTime.getNextMondayUtc() method to calculate next Monday at 00:00 UTC
- Update AllianceMobilizationTask to retry on next Monday instead of 5 minutes when navigation fails
- Remove obsolete TODO comment about scheduling logic
- Remove unused taskIsGood variable
Replace while loop with TemporalAdjusters.next() for better readability and performance
…edule

feat: reschedule Alliance Mobilization task to next Monday when event is inactive
Copilot AI review requested due to automatic review settings October 7, 2025 17:49
@camoloqlo
camoloqlo merged commit 7146b08 into dev Oct 7, 2025
3 checks passed
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @camoloqlo, 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 significantly enhances the application's user interface and backend logic, primarily focusing on the priority list system. It introduces a more robust and user-friendly drag-and-drop experience with auto-scrolling, centralizes priority list management for easier extensibility, and integrates a new feature for prioritizing expert skill training. Additionally, it refines stamina tracking and display in the UI, and improves emulator resource management for better stability and performance.

Highlights

  • Priority List System Refactoring: The core logic for registering and initializing priority lists has been centralized in AbstractProfileController, simplifying setup for individual controllers and ensuring consistent default handling when profiles are loaded without saved configurations.
  • Enhanced Drag-and-Drop with Auto-Scroll: The PriorityListView component now features auto-scroll functionality during drag-and-drop operations, improving usability for reordering items in long lists. Scroll speed is proportional to proximity to the list's edges, controlled by an AnimationTimer.
  • Improved Styling with CSS Classes: Styling for PriorityListView and its cells has been migrated from inline styles to CSS classes, enhancing maintainability, theming capabilities, and visual feedback during drag-and-drop.
  • New Expert Skill Training Feature: A new 'Expert Skill Training' section has been added to the Experts module, allowing users to prioritize and automate the training of expert skills with a dedicated priority list.
  • Stamina Management and UI Updates: The stamina service now includes a listener mechanism to notify UI components of stamina changes, enabling real-time updates to the application's window title to display current stamina levels.
  • Emulator Slot Management Improvements: The emulator manager now tracks active slots more robustly, preventing a single thread from acquiring multiple slots and ensuring accurate slot availability, particularly when threads attempt to release slots they don't hold.
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 by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

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 pull request 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 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

  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.

@gemini-code-assist gemini-code-assist 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.

Code Review

This is a large and impressive pull request that significantly refactors and enhances the priority list UI, drag-and-drop functionality, and background task management. The move from inline styles to CSS classes is a great step for maintainability. The addition of auto-scrolling and more robust handling of priority lists and emulator slots are excellent improvements. I've found a few minor issues, mainly related to type safety and a small logic bug, but overall the changes are very positive.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull Request Overview

Refactor and feature updates across scheduling, UI priority lists, and task logic to improve maintainability, drag-and-drop UX, and stamina handling.

  • Centralizes priority list registration/initialization in AbstractProfileController and adds CSS-based, auto-scrolling PriorityListView.
  • Introduces ExpertSkillTrainingTask with new enum/config, adds stamina listeners to update UI titles, and improves common OCR/retry utilities in DelayedTask.
  • Adjusts queue handling and emulator slot management; minor fixes across multiple tasks and utilities.

Reviewed Changes

Copilot reviewed 36 out of 44 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
wos-utiles/src/main/resources/styles/style.css Adds CSS classes for priority list UI and drag indicators.
wos-utiles/src/main/java/cl/camodev/utiles/UtilTime.java Adds getNextMondayUtc; minor change to parseTimeToSeconds logging.
wos-utiles/src/main/java/cl/camodev/utiles/StyleConstants.java Centralizes CSS class constants for PriorityListView.
wos-utiles/src/main/java/cl/camodev/utiles/ImageSearchUtil.java Minor readability adjustments and precise center calculations.
wos-serv/src/main/java/.../StorehouseChest.java Minor cleanup of OCR integer extraction call.
wos-serv/src/main/java/.../PolarTerrorHuntingTask.java Refactors DnD flow and stamina/travel time handling via DelayedTask helpers.
wos-serv/src/main/java/.../PetSkillsTask.java Reads pet stamina skill level to credit stamina; fixes typos.
wos-serv/src/main/java/.../MercenaryEventTask.java Refactors scouting/attack; uses helpers for stamina and travel time.
wos-serv/src/main/java/.../JourneyofLightTask.java Uses default OCR retries; logging adjustments.
wos-serv/src/main/java/.../IntelligenceTask.java Logic cleanup; uses retries for searches; OCR settings tuned.
wos-serv/src/main/java/.../HeroMissionEventTask.java Uses common stamina parsing and subtraction helper.
wos-serv/src/main/java/.../GatherTask.java Smarter resource level handling with OCR; UX/logging tweaks.
wos-serv/src/main/java/.../ExpertSkillTrainingTask.java New expert skill training task based on prioritized config.
wos-serv/src/main/java/.../BeastSlayTask.java Uses plusMinutes instead of ChronoUnit.
wos-serv/src/main/java/.../AllianceTechTask.java OCR PSM mode adjusted.
wos-serv/src/main/java/.../AllianceShopTask.java OCR PSM mode adjusted; comments.
wos-serv/src/main/java/.../AllianceMobilizationTask.java Reschedules to next Monday UTC if event inactive.
wos-serv/src/main/java/.../TaskQueue.java Virtual thread scheduling, improved idle handling and background checks.
wos-serv/src/main/java/.../DelayedTaskRegistry.java Registers ExpertSkillTrainingTask.
wos-serv/src/main/java/.../DelayedTask.java Adds shared OCR/parse helpers and stamina utilities.
wos-serv/src/main/java/.../StaminaService.java Adds listener support; notifies on stamina changes.
wos-serv/src/main/java/.../IStaminaChangeListener.java New listener interface for stamina changes.
wos-serv/src/main/java/.../EmulatorManager.java Tracks active slots per thread and prevents double-acquire; reset clears.
wos-persitence/src/main/resources/META-INF/persistence.xml Adds sqlite busy_timeout and WAL journal mode.
wos-ot/src/main/java/.../TpDailyTaskEnum.java Adds EXPERT_SKILL_TRAINING enum.
wos-ot/src/main/java/.../ExpertSkillItem.java New enum of expert skills for prioritization.
wos-ot/src/main/java/.../EnumTemplates.java Adds templates for expert training UI.
wos-ot/src/main/java/.../EnumConfigurationKey.java Adds config flags/keys for expert skill training.
wos-hmi/src/main/resources/.../ExpertsLayout.fxml Adds UI for expert skill training with PriorityListView.
wos-hmi/src/main/java/.../FXApp.java Safeguards resource load; sets window min size.
wos-hmi/src/main/java/.../LauncherLayoutController.java Updates title with live stamina using listener; async start/stop.
wos-hmi/src/main/java/.../LauncherActionController.java Ensures UI updates happen on FX thread.
wos-hmi/src/main/java/.../ExpertsLayoutController.java Wires expert skill PriorityListView registration and visibility.
wos-hmi/src/main/java/.../PriorityListView.java CSS-based styling, drag auto-scroll, and improved priority numbering.
wos-hmi/src/main/java/.../AbstractProfileController.java Adds generic priority list registration and default reinitialization.
wos-hmi/src/main/java/.../AllianceShopController.java Uses new priority list registration; removes manual merge.

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +465 to +469
DTOImageSearchResult resource = searchTemplateWithRetries(gatherType.getTemplate());
if (!resource.isFound()) {
logInfo("March queue for " + gatherType.getName()
+ " is not used. Checking for next available march queue... (Used: " + activeMarchQueues + "/"
+ totalMarchesAvailable + ")");

Copilot AI Oct 7, 2025

Copy link

Choose a reason for hiding this comment

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

searchTemplateWithRetries expects an EnumTemplates, but gatherType.getTemplate() returns a String path. This will not compile. Either add an overload that accepts a String (and optional ROI), or call emuManager.searchTemplate with the String signature as before.

Copilot uses AI. Check for mistakes.
StaminaService.getServices().subtractStamina(profile.getId(), 25);
} else {
logWarning("No stamina value found on deployment. Default spending to 10 stamina.");
StaminaService.getServices().subtractStamina(profile.getId(), 25);

Copilot AI Oct 7, 2025

Copy link

Choose a reason for hiding this comment

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

The non-rally branch logs 'Default spending to 10 stamina' but subtracts 25. Align the subtraction to 10 to match the intended default.

Suggested change
StaminaService.getServices().subtractStamina(profile.getId(), 25);
StaminaService.getServices().subtractStamina(profile.getId(), 10);

Copilot uses AI. Check for mistakes.
Comment on lines +430 to +431
// Keep base CSS class
getStyleClass().setAll(StyleConstants.PRIORITY_LIST_CELL);

Copilot AI Oct 7, 2025

Copy link

Choose a reason for hiding this comment

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

Using getStyleClass().setAll(...) here replaces built-in ListCell style classes (e.g., 'list-cell', 'indexed-cell'), which can break default selection/hover behavior and CSS. Preserve default classes and add your custom one instead, e.g.: getStyleClass().setAll("list-cell", StyleConstants.PRIORITY_LIST_CELL); or simply clear only custom markers and add the custom class with add().

Suggested change
// Keep base CSS class
getStyleClass().setAll(StyleConstants.PRIORITY_LIST_CELL);
// Keep base CSS class and preserve default ListCell style classes
getStyleClass().setAll("list-cell", StyleConstants.PRIORITY_LIST_CELL);

Copilot uses AI. Check for mistakes.
return (long) hours * 3600 + (long) minutes * 60 + seconds;
} catch (NumberFormatException e) {

System.out.println("Unable to parse time: " + timeStr);

Copilot AI Oct 7, 2025

Copy link

Choose a reason for hiding this comment

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

Avoid printing to stdout in library code; use the project's logger (or remove) to prevent noisy console output in production.

Copilot uses AI. Check for mistakes.
Comment on lines +78 to +82
if (trainingTime==null){
return;
}
logInfo("A skill is currently being trained. Rescheduling task to run after training completes in " + trainingTime.toMinutes() + " minutes.");
reschedule(LocalDateTime.now().plus(trainingTime));

Copilot AI Oct 7, 2025

Copy link

Choose a reason for hiding this comment

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

When trainingTime is null, execute() returns without rescheduling or closing the popup, which can leave the task unscheduled and the UI in an inconsistent state. Add a fallback reschedule (e.g., 10 minutes) and close any open dialogs before returning.

Copilot uses AI. Check for mistakes.

if (badgeResult.isFound()) {
logInfo("Successfully started training for skill: " + priorityItem.getName() + " with duration: " + learningTime.label());
this.reschedule(LocalDateTime.now().plus(learningTime.duration())); // add 1 minute buffer

Copilot AI Oct 7, 2025

Copy link

Choose a reason for hiding this comment

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

The comment says 'add 1 minute buffer' but the code schedules exactly the duration. Either add the intended buffer (e.g., plusMinutes(1)) or update the comment to avoid confusion.

Suggested change
this.reschedule(LocalDateTime.now().plus(learningTime.duration())); // add 1 minute buffer
this.reschedule(LocalDateTime.now().plus(learningTime.duration()).plusMinutes(1)); // add 1 minute buffer

Copilot uses AI. Check for mistakes.
public static final String PRIORITY_LIST_CELL_HOVER = "priority-list-cell-hover";
public static final String PRIORITY_LIST_CELL_DRAG_OVER_TOP = "priority-list-cell-drag-over-top";
public static final String PRIORITY_LIST_CELL_DRAG_OVER_BOTTOM = "priority-list-cell-drag-over-bottom";
public static final String PRIORITY_LIST_CELL_DISABLED = "priority-list-cell-disabled";

Copilot AI Oct 7, 2025

Copy link

Choose a reason for hiding this comment

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

These constants have no corresponding CSS classes in styles/style.css (hover is defined via the ':hover' pseudoclass, and there's no 'priority-list-cell-disabled'). Either add matching CSS rules or remove these constants to prevent confusion.

Suggested change
public static final String PRIORITY_LIST_CELL_DISABLED = "priority-list-cell-disabled";

Copilot uses AI. Check for mistakes.
Comment on lines 83 to +86
if (nextQueueDateTime.isBefore(nextScheduleTime)) {
nextScheduleTime = nextQueueDateTime;
}
logInfo("Next queue time for queue " + profile.getName() + ": " + nextQueueTime.toLowerCase());

Copilot AI Oct 7, 2025

Copy link

Choose a reason for hiding this comment

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

The log message uses profile.getName() where a queue identifier/index would be expected, which makes the message misleading. Replace with a meaningful queue label or index.

Copilot uses AI. Check for mistakes.
neptune-dev-23 pushed a commit to neptune-dev-23/wosbot that referenced this pull request Oct 13, 2025
neptune-dev-23 pushed a commit to neptune-dev-23/wosbot that referenced this pull request Oct 13, 2025
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.

4 participants