Skip to content

Fix: Restore missing right-click menu options for temporal table history tables in Object Explorer#21662

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/fix-child-table-context-menu
Draft

Fix: Restore missing right-click menu options for temporal table history tables in Object Explorer#21662
Copilot wants to merge 2 commits intomainfrom
copilot/fix-child-table-context-menu

Conversation

Copy link
Contributor

Copilot AI commented Mar 18, 2026

Temporal table history nodes (nodeType = "HistoryTable") were only showing Refresh and Copy Object Name in the Object Explorer context menu — missing New Query, Select Top 1000, Generate Script, and Open in Copilot actions that regular Table nodes expose.

Root Cause

All affected when clauses in package.json matched only type=(Table). History table nodes report type=HistoryTable, so they fell through every menu condition except the generic ones.

Changes

  • package.jsonview/item/context menu entries: Added HistoryTable to the when clause regex for:

    • mssql.objectExplorerNewQuery (New Query)
    • mssql.scriptSelect (Select Top 1000)
    • mssql.sqlScriptsSubmenu (Generate Script submenu)
    • mssql.objectExplorerChatWithDatabase (Open in Copilot Chat)
    • mssql.objectExplorerChatWithDatabaseInAgentMode (Open in Copilot Agent)
  • package.jsoncommandPalette entries: Added HistoryTable to mssql.scriptSelect, mssql.scriptCreate, and mssql.scriptDelete conditions.

mssql.editTable and mssql.tableExplorer are intentionally excluded — history tables are system-managed and read-only, consistent with SSMS behavior.

Code Changes Checklist

  • New or updated unit tests added
  • All existing tests pass (npm run test)
  • Code follows contributing guidelines
  • Telemetry/logging updated if relevant
  • No regressions or UX breakage

Reviewers: Please read our reviewer guidelines

Original prompt

This section details on the original issue you should resolve

<issue_title>[Bug]: Temporal table child tables missing right-click menu options</issue_title>
<issue_description>### Description

A SQL Server Temporal Table has a parent/current table and a child/history table. In the Explorer UI, the child table is nested below the parent. When right-clicking the child table, the only options are "Copy Object Name" and "Refresh". There are no options for "Select Top 1000", "New Query", etc. Contrast this with SSMS where the parent and child tables are treated largely the same with similar options.

This is inconvenient when trying to investigate temporal table schema and data.

Steps to Reproduce

  1. Expand a temporal table
  2. Right click the child table
  3. Compare with parent table or SSMS options

Affected Area

  • Connection dialog (SQL Server | Azure browse/Fabric browse)
  • Query editor
  • Query results panel
  • Object Explorer
  • GitHub Copilot integration
  • Preview/Edit data
  • Table Designer
  • Schema Designer
  • Schema Compare
  • Local SQL Server Container provisioning
  • SQL database in Fabric provisioning
  • DACPAC/BACPAC export/import
  • SQL Database projects
  • Query Plan Visualizer
  • Other (please describe below)

If you selected "Other", please describe the affected area

No response

Environment Information

VSCode: 1.111.0
MSSQL: 1.40.0

Confirmation

  • I have searched existing issues and couldn't find a match
  • I want to work on this issue</issue_description>

<agent_instructions>The type of the sub table is "HistoryTable". Your changes will largely be in package.json, but you may also need to update the commands themselves.

The missing menu items are:

  • New query
  • Select top 1000
  • Generate Script submenu
  • Open in Copilot (chat + agent)</agent_instructions>

Comments on the Issue (you are @copilot in this section)

@Benjin SSMS context menu for parent: Image

SSMS context menu for history table:
Image

Looks like there should be SELECT TOP 1000 and Script Table As..., but neither have "New Query".

MSSQL parent:

Image

MSSQL history:

Image</comment_new>


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Co-authored-by: Benjin <1609827+Benjin@users.noreply.github.com>
Copilot AI changed the title [WIP] [Bug] Fix missing right-click menu options for child tables Fix: Restore missing right-click menu options for temporal table history tables in Object Explorer Mar 18, 2026
Copilot AI requested a review from Benjin March 18, 2026 15:11
@lewis-sanchez lewis-sanchez self-requested a review March 18, 2026 17:14
@github-actions
Copy link

PR Changes

Category Target Branch PR Branch Difference
vscode-mssql VSIX 6450 KB 6441 KB ⚪ -9 KB ( 0% )
sql-database-projects VSIX 7062 KB 7062 KB ⚪ 0 KB ( 0% )
data-workspace VSIX 535 KB 535 KB ⚪ 0 KB ( 0% )

@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.96%. Comparing base (32b0b4c) to head (da0ec4f).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main   #21662   +/-   ##
=======================================
  Coverage   72.96%   72.96%           
=======================================
  Files         331      331           
  Lines       99314    99314           
  Branches     5588     5588           
=======================================
  Hits        72460    72460           
  Misses      26854    26854           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

[Bug]: Temporal table child tables missing right-click menu options

4 participants