Skip to content

feat(inventory-list): add Shift-reverse, Ctrl-reset, and RBM state cycling columns - #187

Open
zndxcvbn wants to merge 6 commits into
mainfrom
feat-improve-column-nav
Open

zndxcvbn wants to merge 6 commits into
mainfrom
feat-improve-column-nav

Conversation

@zndxcvbn

@zndxcvbn zndxcvbn commented Apr 29, 2026

Copy link
Copy Markdown
Collaborator

This PR enhances the tabular list header navigation and sorting logic to provide a more flexible "DataGrid-like" experience:

  1. Shift + LBM/RBM: Toggles the sorting direction (Ascending <-> Descending) for the Name column state without cycling to the next category.
  2. Right Click (RBM): Cycles through column Name states in reverse (e.g., Name <- Enchanted <- Stolen).
  3. Ctrl + LBM: Clears custom sorting and resets the list to the default primary column and direction (Name, Ascending).

Summary by CodeRabbit

  • New Features

    • Shift-modified column clicks toggle an alternate reverse/sort direction; auxiliary/right-click cycles selection backward; Ctrl clears sorting. Column header presses now honor Shift/Ctrl and auxiliary button input.
    • Sorting/selection is persisted so chosen column and direction remain across views.
  • Bug Fixes

    • Column sort indicator now correctly reflects the alternate reverse state.

@coderabbitai

coderabbitai Bot commented Apr 29, 2026

Copy link
Copy Markdown
Contributor

Warning

Rate limit exceeded

@zndxcvbn has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 42 minutes and 14 seconds before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 4b48141d-d9c3-45c2-8b30-8728a95087b8

📥 Commits

Reviewing files that changed from the base of the PR and between 4dd3f8e and 0304900.

📒 Files selected for processing (1)
  • source/swfsources.cmake
📝 Walkthrough

Walkthrough

List sorting controls were extended: ListLayout gained shift-aware column selection, reverse-cycle and clear-sorting APIs; SortedListHeader forwards shift/aux/ctrl inputs to the new APIs; build sources were updated to include the modified ActionScript files. State persists to the list preference store.

Changes

Cohort / File(s) Summary
List layout & sorting logic
source/actionscript/Common/skyui/components/list/ListLayout.as
Adds _forceReverse state; updates selectColumn(a_index, a_bShift) signature and behavior; adds selectColumnPrev(a_index, a_bShift) and clearSorting(); fixes column-list reference and adjusts updateSortParams to handle arrays, XOR inverting sort bits when _forceReverse applies.
Header input handlers
source/actionscript/Common/skyui/components/list/SortedListHeader.as
Updates columnPress(a_columnIndex, a_bShift) signature; adds columnRightPress(a_columnIndex, a_bShift) and columnCtrlPress(a_columnIndex); routes press/aux/ctrl/shift states to ListLayout accordingly.
Build sources
source/swfsources.cmake
Adds the two modified ActionScript files to the SOURCES list for craftingmenu.swf and skyui/inventorylists.swf targets.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Header as SortedListHeader
    participant Layout as ListLayout
    participant Pref as _prefData
    participant View as ListView
    User->>Header: click / right-click / ctrl+click (with Shift state)
    Header->>Layout: columnPress / columnRightPress / columnCtrlPress (pass a_bShift)
    Layout->>Layout: update active column, _forceReverse, or clear sorting
    Layout->>Pref: persist selected column and state
    Layout->>View: refresh layout / updateSortParams
    View->>Layout: provide primary column info (if clearing)
    Layout->>View: apply updated sorting/display
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main changes: Shift-reverse toggle, Ctrl-reset, and RBM state cycling. It directly reflects the three key features added across the modified files.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
Review rate limit: 0/1 reviews remaining, refill in 42 minutes and 14 seconds.

Comment @coderabbitai help to get the list of available commands and usage tips.

@zndxcvbn zndxcvbn changed the title feat(inventory-list): add a reverse state transition for the Name column feat(inventory-list): add Shift-reverse, Ctrl-reset, and RBM state cycling Apr 29, 2026
@zndxcvbn zndxcvbn changed the title feat(inventory-list): add Shift-reverse, Ctrl-reset, and RBM state cycling feat(inventory-list): add Shift-reverse, Ctrl-reset, and RBM state cycling columns Apr 29, 2026
@zndxcvbn zndxcvbn added deferred Will be considered at a later date labels May 1, 2026
@codepuncher

Copy link
Copy Markdown
Contributor

As a controller user, I'd love to have this feature but I can't think of how it would be activated with limited buttons. Have you any thoughts on how it could be doable?
Perhaps a column sort type for name (asc) and name (desc)? that way all users can use the feature. Or perhaps holding down left stick button change direction or show a tooltip/menu for the options?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

deferred Will be considered at a later date

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants