Repository navigation
feat(webui): add @ mentions for workspace files and recent chats - #2011
Open
fengchen122123-sudo wants to merge 1 commit into
Open
fengchen122123-sudo wants to merge 1 commit into
fengchen122123-sudo wants to merge 1 commit into
Conversation
This branch has not been deployed
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.
Scope
Scope boundary: the WebUI chat composer only — typing
@in the message input opens a mention palette with two candidate groups (workspace files/directories and recent chat sessions) and inserts the chosen target into the message text.What changed:
opensquilla-webui/src/utils/chat/mentionQuery.ts— pure parsing helpers:mentionQueryAtlocates the@token ending at the caret,mentionTargetsplits a typed query into directory + fragment,mentionMatchRankranks exact/prefix/substring matches,replaceMentionQueryswaps the token for its insertion text. A palette only opens on a standalone@, so e-mail addresses, handles and mid-word@stay prose.opensquilla-webui/src/composables/chat/useChatMentions.ts— candidate fetching and panel state: per-directory listing cache, an epoch counter that fences stale refreshes, and a cache reset whenever the session (and therefore the workspace root) changes.opensquilla-webui/src/components/chat/ChatMentionPalette.vue— the panel; directories are listed asname/, files and sessions are visually distinguished, and each kind gets a different insertion text (@path,@path/,@title (session:<key>)).ChatComposer.vue,ChatView.vueanduseChatComposerShortcuts.ts— wiring: open/close, arrow-key navigation, insertion, and outside-click dismissal.Keyboard and pointer behaviour: Up/Down move the selection, Enter inserts the highlighted candidate, Esc closes the palette, and a click outside the panel also closes it.
Data source: the palette reuses existing modules only — it calls
workspaceFiles.listDirandsessionDirectory.listPage. No new RPC method and no Gateway contract change.Non-goals: no new RPC/Gateway endpoints and no backend changes; no attachment or file-content resolution beyond the inserted token text; no change to how messages are submitted.
Branch
Base branch: main
Target exception: N/A
Issue
Linked issue: None
If None, reason: this is a self-contained WebUI composer improvement; no existing issue or tracking item was referenced for this branch.
Release Note
Release note: The chat composer now supports
@mentions for workspace files and recent sessions.Tests
Ruff: N/A — no Python files changed.
Pytest: N/A — no Python files changed.
Build:
node scripts/typecheck-vue.mjs --noEmit— exit code 0 (Vue SFC typecheck, TypeScript 6.0.3).Regression tests: added
Notes: 35 new vitest cases pass across three files —
mentionQuery.test.ts(18),useChatMentions.test.ts(11) andChatMentionPalette.test.ts(6).useChatComposerShortcuts.test.tswas extended to cover the new palette key handling.npm run check:architecturepasses end to end (architecture guard, transport boundary, production validator policy, chat security, colour/motion/radius, theme contract, theme scope, cross-surface accent, plus the i18n, channel-catalog and README-locale gates). Tests are offline, deterministic and credential-free.The default test path remains offline, deterministic, credential-free, and safe for forks.
Maintainer Live Check
Maintainer live check: no
Surface: N/A
Maintainer-only note: contributors are not expected to provide secrets or run credentialed live checks. Maintainers may run
Live Release E2Efor provider, browser, gateway, channel, or release smoke coverage.Safety
No secrets, local-only artifacts, private prompts/transcripts, channel identifiers, AI session artifacts or non-public fixtures are included. The local scratch file
opensquilla-webui/t3.logwas deliberately left untracked and is not part of this branch.Third-Party Origin
Third-party origin: none
Details if non-none: N/A
Documentation Changes
No documentation files are changed by this PR, so the checklist below does not apply: