Conversation
# 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
…tarting device when adb won't connect
# 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
…gs for alliance coin reading
maintenance/MiscChanges
Also clean some unused imports and dead/redundant code
…icate acquisitions
…and reduce looping
…and enhance efficiency
… 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
Summary of ChangesHello @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
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.
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.
There was a problem hiding this comment.
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.
| 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 + ")"); |
There was a problem hiding this comment.
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.
| 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); |
There was a problem hiding this comment.
The non-rally branch logs 'Default spending to 10 stamina' but subtracts 25. Align the subtraction to 10 to match the intended default.
| StaminaService.getServices().subtractStamina(profile.getId(), 25); | |
| StaminaService.getServices().subtractStamina(profile.getId(), 10); |
| // Keep base CSS class | ||
| getStyleClass().setAll(StyleConstants.PRIORITY_LIST_CELL); |
There was a problem hiding this comment.
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().
| // 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); |
| return (long) hours * 3600 + (long) minutes * 60 + seconds; | ||
| } catch (NumberFormatException e) { | ||
|
|
||
| System.out.println("Unable to parse time: " + timeStr); |
There was a problem hiding this comment.
Avoid printing to stdout in library code; use the project's logger (or remove) to prevent noisy console output in production.
| 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)); |
There was a problem hiding this comment.
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.
|
|
||
| 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 |
There was a problem hiding this comment.
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.
| this.reschedule(LocalDateTime.now().plus(learningTime.duration())); // add 1 minute buffer | |
| this.reschedule(LocalDateTime.now().plus(learningTime.duration()).plusMinutes(1)); // add 1 minute buffer |
| 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"; |
There was a problem hiding this comment.
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.
| public static final String PRIORITY_LIST_CELL_DISABLED = "priority-list-cell-disabled"; |
| if (nextQueueDateTime.isBefore(nextScheduleTime)) { | ||
| nextScheduleTime = nextQueueDateTime; | ||
| } | ||
| logInfo("Next queue time for queue " + profile.getName() + ": " + nextQueueTime.toLowerCase()); |
There was a problem hiding this comment.
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.
merge master into dev
merge master into dev
This pull request introduces several improvements to the profile priority list system and enhances the
PriorityListViewcomponent, 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:
registerPriorityListmethod inAbstractProfileControllerto associate eachPriorityListViewwith 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)wos-hmi/src/main/java/cl/camodev/wosbot/common/view/AbstractProfileController.java) [1] [2]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:
PriorityListViewduring 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 anAnimationTimer. (wos-hmi/src/main/java/cl/camodev/wosbot/common/view/PriorityListView.java) [1] [2] [3] [4]wos-hmi/src/main/java/cl/camodev/wosbot/common/view/PriorityListView.java) [1] [2]Styling and Code Quality:
wos-hmi/src/main/java/cl/camodev/wosbot/common/view/PriorityListView.java) [1] [2]Comparator.comparingIntand 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.