Refresh @ file mentions for new and spaced paths - #67
Merged
hardbeat920 merged 3 commits intoSep 5, 2026
Conversation
Keep @ mentions in sync with files added on disk by invalidating the in-memory listing on focus and directory changes, and by not dropping a refresh that arrives while a scan is already in flight.
Show spaced files and folders in the picker, insert a single-word @ token, and resolve it to the real project-relative path on send. Skip paths that leave the workspace or would break the tokenizer.
Owner
|
Looks great overall @elanchezhiyanr. Could you reject Unicode line separators and bidi control characters in isSafeProjectRelative() and add a regression test? |
Mentionable relatives must not include control, format, or line/paragraph separator characters, so a crafted name cannot split the prompt or spoof the token. Add regression coverage for those cases.
Contributor
Author
|
Hi @hardbeat920 Thanks. Done in the latest commit.
|
Owner
|
Thanks @elanchezhiyanr, this addresses my concern. Looks good to merge! |
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.
What changed
The project file index now refreshes on window focus and directory-change notifications, and a refresh is no longer dropped if a scan is already in flight. The composer
@picker subscribes to those updates.Paths with spaces are included in
@. The picker still shows the real name. Picking one inserts a single-word@token (spaces become hyphens). On send, the prompt maps that token to the real project-relative path. Paths that leave the workspace or would break the tokenizer are skipped.Why
@used a stale in-memorygit ls-filescache. The explorer already reloaded on focus; the mention list did not. Files copied into the project from Finder therefore did not appear until something else forced a full reload.@tokens are one whitespace-delimited word, so spaced names were excluded entirely. They now stay a normal@labelin the composer, with the real path recovered from the mention index on send rather than decoded from user text.UI
Behavior only. Copy a file or a folder (including names with spaces) into the project, return to MonoCode, type
@plus part of the name, pick it, and confirm it is referenced in the prompt.Checklist
npm run checkFixes #66