Skip to content

feat(webui): add @ mentions for workspace files and recent chats - #2011

Open
fengchen122123-sudo wants to merge 1 commit into
TokenRhythm:mainfrom
fengchen122123-sudo:feat/chat-mentions
Open

fengchen122123-sudo wants to merge 1 commit into
TokenRhythm:mainfrom
fengchen122123-sudo:feat/chat-mentions

Conversation

@fengchen122123-sudo

Copy link
Copy Markdown
Contributor

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: mentionQueryAt locates the @ token ending at the caret, mentionTarget splits a typed query into directory + fragment, mentionMatchRank ranks exact/prefix/substring matches, replaceMentionQuery swaps 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 as name/, files and sessions are visually distinguished, and each kind gets a different insertion text (@path, @path/, @title (session:<key>)).
  • ChatComposer.vue, ChatView.vue and useChatComposerShortcuts.ts — wiring: open/close, arrow-key navigation, insertion, and outside-click dismissal.
  • Locale keys added to all six locales (en, zh-Hans, ja, fr, de, es).

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.listDir and sessionDirectory.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) and ChatMentionPalette.test.ts (6). useChatComposerShortcuts.test.ts was extended to cover the new palette key handling. npm run check:architecture passes 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 E2E for 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.log was 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:

  • Links point to existing repository files or stable external pages.
  • Code fences and Markdown tables render correctly on GitHub.
  • Examples avoid real secrets, local private paths, and private transcripts.

This branch has not been deployed

No deployments
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