Conversation
Improvements
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Updates Druid to 1.2.6 with performance/behavior improvements in core input + scrolling components, deprecating some legacy setter names (set_to) in favor of clearer APIs, and expanding documentation and unit test coverage.
Changes:
- Optimize Scroll/DataList/Drag/Hover internals (less per-frame work/allocation; improved wheel + hover behavior).
- Introduce/standardize new enabling + setter APIs (
set_enabled,set_value,set_text) while keeping deprecated aliases. - Refresh docs/changelog and add/adjust unit tests for newly covered components.
Reviewed changes
Copilot reviewed 34 out of 34 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| wiki/styles.md | Updates style discovery guidance and links to in-repo API docs. |
| wiki/creating_custom_components.md | Reframes guidance to prefer widgets; updates base type naming. |
| wiki/changelog.md | Adds the 1.2.6 release notes. |
| test/tests/test_static_grid.lua | Reworks Static Grid tests to cover index/size helpers. |
| test/tests/test_slider.lua | Adds slider unit tests. |
| test/tests/test_hotkey.lua | Adds hotkey unit tests (single + modifier combos). |
| test/tests/test_druid_instance.lua | Updates tests to use set_value instead of deprecated set_to. |
| test/tests/test_data_list.lua | Adds DataList tests for refresh gating + cache mode behaviors. |
| test/test.gui_script | Registers the new/updated test modules. |
| game.project | Bumps project version to 1.2.6. |
| example/examples/gamepad/gamepad_tester/gamepad_tester.lua | Migrates trigger progress setters to set_value. |
| example/examples/basic/progress_bar/basic_progress_bar_slice9.lua | Migrates progress setter to set_value. |
| example/examples/basic/progress_bar/basic_progress_bar.lua | Migrates progress setter to set_value. |
| druid/system/druid_instance.lua | Adds O(1) whitelist/blacklist lookup sets; allows clearing lists with nil. |
| druid/extended/timer.lua | Renames primary API to set_value, keeps set_to as deprecated alias. |
| druid/extended/swipe.lua | Adds set_enabled / is_enabled to Swipe. |
| druid/extended/slider.lua | Removes double scene-scale compensation during drag. |
| druid/extended/progress.lua | Renames primary API to set_value, adds get_value, keeps deprecated alias. |
| druid/extended/lang_text.lua | Renames primary API to set_text, keeps set_to as deprecated alias. |
| druid/extended/input.lua | Improves typing annotations, allows BACK action, adds focus/modifier filtering and get_text_visual. |
| druid/extended/data_list.lua | Gates refresh work and scroll size rebuild; triggers on_scroll_progress_change on scroll. |
| druid/extended/container.lua | Avoids fit_into_window() when fit_size mode is active. |
| druid/custom/rich_input/rich_input.lua | Removes extra manual scene-scale division after screen_to_local. |
| druid/const.lua | Adds action constants for LALT and TAB. |
| druid/base/text.lua | Makes set_text the primary API; keeps set_to as deprecated alias. |
| druid/base/static_grid.lua | Clarifies Static Grid docstring and creation method. |
| druid/base/scroll.lua | Removes internal hover dependency; improves wheel picking, early-outs, and avoids vector allocs. |
| druid/base/hover.lua | Skips pick work when no listeners/cursor styles are configured. |
| druid/base/drag.lua | Lazily creates Hover only when drag cursors enabled; allows customizing drag actions. |
| druid/base/button.lua | Improves EmmyLua style and event/callback annotations. |
| api/components/extended/data_list_api.md | Updates DataList docs to prefer cache mode and clarify Static Grid usage. |
| api/components/base/button_api.md | Updates button event naming and callback signature docs. |
| README.md | Updates dependency pins, fixes “Static Grid” link text. |
| CONTRIBUTING.md | Fixes issue tracker URL; documents API docs workflow; clarifies test registration + CI note. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #344 +/- ##
==========================================
+ Coverage 70.75% 72.81% +2.05%
==========================================
Files 32 31 -1
Lines 4562 4617 +55
==========================================
+ Hits 3228 3362 +134
+ Misses 1334 1255 -79 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 36 out of 36 changed files in this pull request and generated no new comments.
Suppressed comments (6)
druid/base/scroll.lua:90
scroll.hoverwas removed from the component, but the generated API docs still list ahoverfield (and may imply it exists). Please updateapi/components/base/scroll_api.mdto remove/adjust thehoverfield documentation to match the new behavior (wheel picking is now event-based).
self.drag = self.druid:new_drag(view_node, self._on_scroll_drag)
self.drag.on_touch_start:subscribe(self._on_touch_start)
self.drag.on_touch_end:subscribe(self._on_touch_end)
self.on_scroll = event.create()
self.on_scroll_to = event.create()
self.on_point_scroll = event.create()
druid/base/drag.lua:277
- New public methods
add_drag_action/remove_drag_actionwere added, butapi/components/base/drag_api.mddoes not list or describe them in the Functions section. Please update the API markdown so consumers can discover these methods.
---Add an additional input action that can start a drag.
---By default only touch and multitouch actions are allowed.
---Useful to drag with the middle or right mouse button on desktop.
---The action should provide the pointer position, key actions are ignored.
---@param action_id hash The action id to allow for dragging
---@return druid.drag self Current instance
function M:add_drag_action(action_id)
self._allowed_drag_actions[action_id] = true
return self
end
---Remove an additional input action from the allowed drag actions
---@param action_id hash The action id to disallow for dragging
---@return druid.drag self Current instance
function M:remove_drag_action(action_id)
self._allowed_drag_actions[action_id] = nil
return self
end
druid/extended/swipe.lua:131
set_enabled/is_enabledwere added to Swipe, butapi/components/extended/swipe_api.mdstill lists onlyinitandset_click_zone. Please update the API markdown to include the new enabled-state methods.
---Set swipe enabled state
---@param is_enabled boolean
---@return druid.swipe self
function M:set_enabled(is_enabled)
self._is_enabled = is_enabled
if not is_enabled then
self:_reset_swipe()
end
return self
end
---Return current swipe enabled state
---@return boolean
function M:is_enabled()
return self._is_enabled
end
druid/extended/input.lua:398
get_text_visual()is a new public method on Input, butapi/components/extended/input_api.mddoes not mention it in the Functions section. Please update the API markdown so the method is discoverable (and document when it differs fromget_text).
---Return the text currently displayed on the text node.
---Can differ from `get_text` if the text adjust mode trims the value.
---@return string text The visible input field text
function M:get_text_visual()
return gui.get_text(self.text.node)
end
druid/extended/progress.lua:150
- Progress added preferred
set_value()/get_value()(and deprecatedset_to()), butapi/components/extended/progress_api.mdstill documentsset_toas the setter and does not listset_value/get_value. Please update the API markdown to reflect the new preferred API and deprecation.
---Instant fill progress bar to value
---@param to number Progress bar value, from 0 to 1
---@return druid.progress self Current progress instance
function M:set_value(to)
to = helper.clamp(to, 0, 1)
self:_set_bar_to(to)
return self
end
---Instant fill progress bar to value
---@deprecated Use set_value instead
---@param to number Progress bar value, from 0 to 1
---@return druid.progress self Current progress instance
function M:set_to(to)
return self:set_value(to)
end
---Return the current value of the progress bar
---@return number value The current value of the progress bar
function M:get()
return self.last_value
end
---Return the current value of the progress bar
---@return number value The current value of the progress bar
function M:get_value()
return self.last_value
end
druid/extended/timer.lua:100
- Timer added preferred
set_value()(and madeset_to()a deprecated alias), butapi/components/extended/timer_api.mdstill lists onlyset_to. Please update the API markdown to documentset_valueas the preferred setter and markset_toas deprecated (or remove it from the main list).
---Set the timer to a specific value
---@param set_to number Value in seconds
---@return druid.timer self Current timer instance
function M:set_value(set_to)
self.last_value = set_to
gui.set_text(self.node, self:_second_string_min(set_to))
return self
end
---Set the timer to a specific value
---@deprecated Use set_value instead
---@param set_to number Value in seconds
---@return druid.timer self Current timer instance
function M:set_to(set_to)
return self:set_value(set_to)
end
Update scoped filters layout
No description provided.