Skip to content

feat(explorer): copy quoted and qualified object names - #1077

Merged
debba merged 2 commits into
TabularisDB:mainfrom
CreedTech:feat/explorer-copy-object-names
Oct 14, 2026
Merged

debba merged 2 commits into
TabularisDB:mainfrom
CreedTech:feat/explorer-copy-object-names

Conversation

@CreedTech

Copy link
Copy Markdown
Contributor

Fixes #1042

The explorer can now copy a table or view name as plain text, a quoted identifier, or a schema-qualified identifier when a schema is available. It uses the existing quoting helpers for each driver. I also made the submenu open on keyboard focus so the new options are reachable without a mouse.

Checked with pnpm lint, pnpm run build, and the full Vitest suite (5,862 tests).

@CreedTech

Copy link
Copy Markdown
Contributor Author

@debba, I’ve put up the fix for #1042. Could you take a look when you have a moment? The fork checks are waiting for approval.

type="button"
disabled={item.disabled}
aria-expanded={open}
onFocus={() => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARNING: Keyboard accessibility gap - submenu opens on focus but lacks keyboard navigation

The onFocus handler opens the submenu (lines 148-151), but there's no corresponding keyboard support:

  • No onBlur to close submenu when focus leaves
  • No ArrowRight/ArrowLeft handling to navigate into/out of submenu
  • No Escape handling on the submenu trigger button
  • No Tab/Shift+Tab management for focus trapping

This may leave keyboard users unable to close an accidentally opened submenu or navigate into it. Consider adding a onKeyDown handler for ArrowRight (open), ArrowLeft (close), and Escape (close), plus an onBlur with a small delay to close when focus truly leaves the submenu area.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. I added ArrowRight, ArrowLeft, and Escape handling, plus closing when focus leaves the submenu. The focused keyboard tests pass in 169f1ae.

@kilo-code-bot

kilo-code-bot Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: 5 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 4
WARNING 1
SUGGESTION 0
Issue Details (click to expand)

CRITICAL

File Line Issue
src/components/layout/ExplorerSidebar.tsx 2411-2414 Inconsistent copy name implementation - indexes still use old clipboard API (navigator.clipboard.writeText) instead of new createCopyNameItem utility with plain/quoted/qualified options
src/components/layout/ExplorerSidebar.tsx 2453-2456 Inconsistent copy name implementation - foreign keys still use old clipboard API instead of new createCopyNameItem utility
src/components/layout/ExplorerSidebar.tsx 2736-2739 Inconsistent copy name implementation - routines still use old clipboard API instead of new createCopyNameItem utility (schema available via routineSchema)
src/components/layout/ExplorerSidebar.tsx 2795-2798 Inconsistent copy name implementation - triggers still use old clipboard API instead of new createCopyNameItem utility (schema available via triggerSchema)

WARNING

File Line Issue
src/components/ui/ContextMenu.tsx 148-151 Keyboard accessibility gap - submenu opens on focus but lacks keyboard navigation (no onBlur, no ArrowRight/Left/Escape handling, no Tab management)
Files Reviewed (16 files)
  • src/components/layout/ExplorerSidebar.tsx - 5 issues
  • src/components/ui/ContextMenu.tsx - 1 issue
  • src/utils/objectNameCopy.ts - No issues
  • tests/utils/objectNameCopy.test.ts - No issues
  • tests/components/ui/ContextMenu.test.tsx - No issues
  • src/i18n/locales/de.json - No issues
  • src/i18n/locales/en.json - No issues
  • src/i18n/locales/es.json - No issues
  • src/i18n/locales/fr.json - No issues
  • src/i18n/locales/it.json - No issues
  • src/i18n/locales/ja.json - No issues
  • src/i18n/locales/ko.json - No issues
  • src/i18n/locales/pt-BR.json - No issues
  • src/i18n/locales/ru.json - No issues
  • src/i18n/locales/tl.json - No issues
  • src/i18n/locales/zh.json - No issues

Fix these issues in Kilo Cloud


Reviewed by free · Input: 236.2K · Output: 7.6K · Cached: 354.2K

@CreedTech

Copy link
Copy Markdown
Contributor Author

The four other copy menus are outside #1042, which covers tables and views. I fixed the keyboard navigation point in the follow-up commit and added tests for focus, Arrow keys, Escape, and blur.

@debba debba left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @CreedTech, thanks for working on #1042! Building on the existing quoteIdentifier / quoteTableRef helpers with activeCapabilities ?? activeDriver keeps the sidebar driver-agnostic, and replacing three inline navigator.clipboard.writeText items with a single builder that uses copyTextToClipboard (with success and error feedback) is a nice cleanup. I really appreciate the extra effort on keyboard access for submenus too: focus to open, ArrowRight/ArrowLeft, and a nested Escape that only closes the flyout, all covered by tests.

Since this is your first PR here: welcome! If you'd like to hang out with us, you're very welcome on our Discord: https://discord.com/invite/K2hmhfHRSt

I'm approving it. A few follow-ups, none of them blocking:

  1. In ContextMenu.tsx, scheduleClose now skips closing while document.activeElement is inside the row. On engines that focus a button on mouse click (Chromium/WebView2 on Windows), clicking the "Copy Name" trigger and then hovering other rows could leave the flyout open until focus moves elsewhere. WKWebView on macOS doesn't focus on click, so it would only show up on Windows/Linux. Worth a quick check there.
  2. The submenu trigger exposes aria-expanded but not aria-haspopup="menu". Minor, but cheap to add.
  3. The "Copy Name" entry in the index context menu still uses the raw navigator.clipboard.writeText(contextMenu.id) without feedback, so it's now a bit inconsistent with tables and views. Could be a small follow-up.

I'll do a manual check on my side before merging.

@debba
debba merged commit 6ca030e into TabularisDB:main Oct 14, 2026
4 of 5 checks passed
@CreedTech

Copy link
Copy Markdown
Contributor Author

@debba, the remaining review follow-ups are in #1374: pointer-focused submenus close on mouse leave while keyboard focus keeps them open, and copying an index name reports success or failure through the shared clipboard helper. aria-haspopup was already fixed upstream. All 86 tests in the two affected suites pass, with types and source lint clean. The focus case is reproduced in the DOM test; I have not checked Windows/WebView2 manually.

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.

[Feat]: Explorer: copy quoted and schema-qualified object names

2 participants