Skip to content

fix(context-chat): remove dead deselect button from read-only source chips - #659

Open
MichelleAntunes wants to merge 1 commit into
nextcloud:mainfrom
MichelleAntunes:fix/context-chat-hide-source-deselect
Open

MichelleAntunes wants to merge 1 commit into
nextcloud:mainfrom
MichelleAntunes:fix/context-chat-hide-source-deselect

Conversation

@MichelleAntunes

Copy link
Copy Markdown

Problem

Each source document shown under a Context Chat answer displays an "×" (deselect) button that does nothing when clicked — the list is a read-only display of referenced sources, not an editable selection.

Root cause

ContextChatOutputForm.vue reuses NcSelect (a multi-select form component) purely for its icon+avatar+label chip styling. In multiple mode, the underlying vue-select library always renders a deselect button on each selected chip, and NcSelect exposes no prop to disable it. The button stays in the DOM, is keyboard-focusable, and is exposed to screen readers via its title attribute — a non-functional control that also carries a minor accessibility cost.

Fix

Replace NcSelect with NcChip (:no-close="true"), a component purpose-built for read-only chip display, available since @nextcloud/vue 8.23.0 (this file predates that release, which is likely why it was never revisited). Scoped styles are adjusted to keep the original bordered, scrollable list container and chip appearance.

Testing

Manually verified in a local Nextcloud AIO instance: sources render with icon + name as before, no deselect button in the DOM (checked via DevTools), and the container keeps its original bordered/scrollable look.
withX
withoutX

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI (N/A)

…list

The sources list reused NcSelect (a multi-select form component) purely for its icon+avatar+label chip styling. In multiple mode, vue-select always renders a deselect (x) button on each chip, and NcSelect exposes no prop to disable it. Since this list is read-only (not an actual selection to edit), the button did nothing when clicked -- a non-functional, misleading control that also stayed focusable and screen-reader-exposed via its title attribute.

Replace NcSelect with NcChip (:no-close="true"), a component purpose-built for read-only chip display and available since @nextcloud/vue 8.23.0. Scoped styles are adjusted to keep the original bordered, scrollable list container.

Signed-off-by: MichelleAntunes <miichelleantunes@outlook.com>
@coderabbitai

coderabbitai Bot commented Sep 23, 2026

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 9e4a9b35-0959-43da-b05b-500953e5982c

📥 Commits

Reviewing files that changed from the base of the PR and between fe8b945 and ff69d60.

📒 Files selected for processing (1)
  • src/components/ContextChat/ContextChatOutputForm.vue

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


📝 Walkthrough

Walkthrough

The sources section replaces its read-only NcSelect dropdown with a list of anchor-wrapped NcChip components. Each chip contains an NcAvatar and links to its source in a new tab. The component registers NcChip instead of NcSelect. Scoped styles add a wrapping, scrollable list and update chip and option styling.

Priority: ⚪ Not assessed

Merge Risk: ⚪ Minimal · up to ff69d

The source display changes to read-only link chips without a confirmed new behavior problem. The change is mergeable after normal checks.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: removing the non-functional deselect button from read-only source chips in Context Chat.
Description check ✅ Passed The description accurately explains the problem, root cause, implementation, and manual testing for the source chip 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 0…
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.

Warning

Some tools did not complete. Review the errors below.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

src/components/ContextChat/ContextChatOutputForm.vue

typescript-eslint does not support TS 7.0.
Please see https://devblogs.microsoft.com/typescript/announcing-typescript-7-0/#running-side-by-side-with-typescript-6.0 to run typescript-eslint using the TS 6 API.
See also typescript-eslint/typescript-eslint#10940 for tracking typescript-eslint's support for TS >=7.1

Oops! Something went wrong! :(

ESLint: 10.11.0

Error: typescript-eslint does not support TS 7.0.
at Object. (/.eslint-tmp/node_modules/typescript-eslint/dist/index.js:52:11)
at Module._compile (node:internal/modules/cjs/loader:1830:14)
at Object..js (node:internal/modules/cjs/loader:1961:10)
at Module.load (node:internal/modules/cjs/loader:1553:32)
at Module._load (node:internal/modules/cjs/loader:1355:12)
at wrapModuleLoad (node:internal/modules/cjs/loader:255:19)
at loadCJSModuleWithModuleLoad (node:internal/modules/esm/translators:326:3)
at ModuleWrap. (node:internal/modules/esm/translators:231:7)
at ModuleJob.run (node:internal/modules/esm/module_job:437:25)
at async node:internal/modules/esm/loader:639:26


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.

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.

1 participant