Skip to content

edit: get_selected_paths - #24

Open
gnome-wizard wants to merge 1 commit into
pirafrank:mainfrom
gnome-wizard:main
Open

edit: get_selected_paths#24
gnome-wizard wants to merge 1 commit into
pirafrank:mainfrom
gnome-wizard:main

Conversation

@gnome-wizard

@gnome-wizard gnome-wizard commented Aug 28, 2026

Copy link
Copy Markdown

Apparently recent versions of yazi changed cx.active.selected to return file objects rather than url objects. However, fs.calc_size() still strictly expects a url object. Passing a file object causes a 'userdata is not expected type' error in my setup.

To fix this, I updated the get_selected_paths function to extract the url property from the returned object. It fixed my issue, I don't know if it can be useful to you.

Summary by CodeRabbit

  • Bug Fixes
    • Improved handling of selected items so file entries are consistently resolved to their URLs.
    • Preserved compatibility with selections provided as raw values.

@coderabbitai

coderabbitai Bot commented Aug 28, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: ace89dfb-db63-48f7-8393-88efe9f2e4aa

📥 Commits

Reviewing files that changed from the base of the PR and between ec94d9a and c299735.

📒 Files selected for processing (1)
  • main.lua

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

get_selected_paths now normalizes selected file objects to their .url values and preserves raw values when no .url field exists.

Changes

Selected path normalization

Layer / File(s) Summary
Normalize selected entries
main.lua
get_selected_paths now supports selected entries that are file objects with a .url field or raw values without one.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Merge Risk: ⚪ Minimal · up to c2997

This change normalizes selected file entries to URLs before size calculation, addressing compatibility with newer yazi versions. No actionable merge-blocking risk remains beyond normal checks and review.

Suggested reviewers: mba380

Poem

A rabbit checked each selected file,
Then found its URL with a smile.
If no URL was there,
The raw path stayed fair,
And the list hopped onward in style.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title identifies the updated get_selected_paths function and matches the main change.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
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.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1 files.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

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

@pirafrank

Copy link
Copy Markdown
Owner

Hi, thanks for submitting. I'll look into it.

It looks like it has been changed with PR 4096, which has been shipped in v26.8.15

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.

2 participants