fix(tui): show plugin directory names for path-registered plugins - #46580
Open
tumbledseea wants to merge 2 commits into
Open
tumbledseea wants to merge 2 commits into
tumbledseea wants to merge 2 commits into
Conversation
Derive the display name for path-registered plugins from the directory basename instead of splitting the raw path on "/". On Windows fileURLToPath returns backslash paths, so the previous split never fired and the /status dialog truncated the whole path at its first dot. Split on both separators and extract the naming logic into a testable helper. Fixes anomalyco#46560
Contributor
|
The following comment was made by an LLM, it may be inaccurate: Potential Duplicate FoundPR #46114 -
Related PR (different but adjacent):
The primary duplicate concern is PR #46114, which seems to solve the same path separator extraction problem for plugin name display in the status dialog. |
Contributor
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue for this PR
Closes #46560
Type of change
What does this PR do?
Path-registered plugins configured by file path showed a truncated path instead of their directory name in the
/statusdialog on Windows.On Windows,
fileURLToPathreturns paths with backslashes, so the previoussplit("/")did not extract the last path segment. The fallbacksplit(".")[0]then cut the full path at the first dot.This PR derives the display name by splitting on both Windows and POSIX separators, and moves the naming logic into a small pure helper covered by tests.
How did you verify your code works?
Added unit tests in
packages/tui/test/component/dialog-status.test.tsfor Windows paths, dotted filenames, index entrypoints, and npm specs.Verified with:
bun typecheckoxlintScreenshots / recordings
N/A. This is not a UI layout change.
Checklist