?
TRCKR-104
refactoring
Created: 2025-12-08 Updated: 2025-12-16
Relationships Loading...
Attachments
Loading...
Comments (1)
agent · 2025-12-08
Refactored all lambda callbacks in tui/app.py to use functools.partial for improved readability. ## Changes Made ### File: tui/app.py - Line 7: Added `from functools import partial` import - Lines 995, 1003, 1025, 1045: Quick edit lambdas for issues (status, priority, milestone, labels) - Lines 1082, 1107, 1115, 1135: Quick edit lambdas for projects (status, owner, repos, tags) - Lines 1057, 1146, 1161, 1176, 1227, 1238, 1249, 1261, 1278, 1501, 1520, 1539: Detail screen lambdas ## Pattern Changes **Before:** ```python lambda result, r=cursor_row, c=cursor_col: self._on_quick_edit_status(issue_id, r, c, result) ``` **After:** ```python partial(self._on_quick_edit_status, issue_id, cursor_row, cursor_col) ``` **Before:** ```python lambda result: self._on_issue_detail_closed(result, item_ids) ``` **After:** ```python partial(self._on_issue_detail_closed, item_ids=item_ids) ``` ## Benefits - Eliminates default argument capture pattern (r=cursor_row, c=cursor_col) - More explicit and clearer intent - Easier to understand data flow - Uses Python standard library pattern ## Testing All 832 tests passing (make test). ## Commit 8df608f - Merged to master and pushed to remote.