Skip to content

Scope Object Explorer colours and show rows affected - #92

Merged
GordonBeeming merged 3 commits into
mainfrom
gb/fix-connection-colours-row-counts
Aug 5, 2026
Merged

GordonBeeming merged 3 commits into
mainfrom
gb/fix-connection-colours-row-counts

Conversation

@GordonBeeming

@GordonBeeming GordonBeeming commented Aug 5, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Keep the Object Explorer shell neutral and apply each connection profile only to that connection's rows.
  • Preserve the profile colours through hover and selection, including a visible selection outline in forced-colours mode.
  • Show zero, singular, and plural SQL affected-row messages, and keep successful statement messages when a later statement fails.

Test plan

  • npm run test:frontend
  • npm run build
  • dotnet test sidecar/Ssmsx.Sidecar.slnx --filter "Category!=Integration"
  • npm run smoke:sidecar
  • node scripts/test-sidecar-contract.mjs
  • cargo test --manifest-path src-tauri/Cargo.toml
  • cargo fmt --manifest-path src-tauri/Cargo.toml --check
  • cargo clippy --manifest-path src-tauri/Cargo.toml --all-targets -- -D warnings
  • cargo check --manifest-path src-tauri/Cargo.toml
  • Verified the real macOS app with two differently coloured connection subtrees, affected-row messages, and a successful write followed by a SQL error.

Summary by CodeRabbit

  • New Features

    • Added affected-row messages for completed SQL statements, including correct singular and plural wording.
    • Preserved informational messages when a later query error occurs.
    • Improved Object Explorer styling with per-connection color profiles, selection indicators, hover states, and forced-colors support.
  • Bug Fixes

    • Fixed message ordering and suppression behavior for PRINT, SET NOCOUNT ON, and query errors.
  • Tests

    • Added comprehensive coverage for query messaging and Object Explorer profile styling.

@coderabbitai

coderabbitai Bot commented Aug 5, 2026 •

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@GordonBeeming, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 31 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: a3631510-56ab-4553-a289-7e5dfd836cd5

📥 Commits

Reviewing files that changed from the base of the PR and between 4dcb34f and 7fecc1f.

📒 Files selected for processing (2)
  • src/index.css
  • tests/frontend/objectExplorerStyles.test.ts
📝 Walkthrough

Walkthrough

The change adds affected-row messages to streamed query results and preserves earlier messages before query errors. It also moves Object Explorer color profiles from the explorer container to individual connection tree rows, with browser coverage for styling and accessibility behavior.

Changes

Query message streaming

Layer / File(s) Summary
Affected-row and error message handling
sidecar/src/Ssmsx.Core/Query/QueryExecutor.cs
QueryExecutor records statement row counts, formats informational affected-row messages, and sends accumulated messages before rethrowing SQL exceptions.
Query message validation
sidecar/tests/Ssmsx.Core.Tests/Query/QueryExecutorTests.cs, scripts/smoke-sidecar.mjs, tests/frontend/queryUi.test.tsx
Tests cover message formatting, ordering, PRINT interleaving, SET NOCOUNT ON, and messages retained before a later query error.

Object Explorer profile styling

Layer / File(s) Summary
Per-connection row styling inputs
src/features/explorer/components/ObjectExplorerTree.tsx, src/features/explorer/components/TreeNode.tsx
The tree resolves connection profiles by connection ID and passes them to TreeNode, which applies profile variables to individual rows.
Profiled row CSS behavior
src/index.css
Profile colors and selected, hover, and forced-colors indicators now target profiled rows.
Profile styling validation
tests/frontend/fixtures/*, tests/frontend/objectExplorerStyles.test.ts, tests/frontend/queryUi.test.tsx
Fixtures and browser tests validate multiple connection profiles, row styling, selection, hover behavior, contrast, and forced-colors outlines.

Estimated code review effort: 4 (Complex) | ~45 minutes

Possibly related PRs

Suggested reviewers: copilot

Sequence Diagram(s)

sequenceDiagram
  participant SQLServer
  participant QueryExecutor
  participant ResponseStream
  participant QueryStore
  SQLServer->>QueryExecutor: StatementCompleted(recordCount)
  QueryExecutor->>ResponseStream: affected-row info message
  SQLServer->>QueryExecutor: Query error
  QueryExecutor->>ResponseStream: accumulated messages
  QueryExecutor-->>ResponseStream: QUERY_ERROR
  ResponseStream->>QueryStore: streamed messages
  QueryStore->>QueryStore: set execution state to failed
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes both main changes: scoped Object Explorer colours and affected-row messages.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch gb/fix-connection-colours-row-counts

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.

@GordonBeeming

Copy link
Copy Markdown
Owner Author

@codex review

@GordonBeeming

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 5, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR updates SSMSx’s Object Explorer theming so connection colour profiles apply per-connection subtree (without tinting the whole explorer shell), and enhances query execution messaging by emitting affected-row messages (0/1/N) while preserving successful messages even when a later statement fails.

Changes:

  • Scope Object Explorer profile colours to individual rows/subtrees and preserve styling through hover/selection (including forced-colours selection outline).
  • Add affected-row message generation in the sidecar (with tests) and ensure messages are delivered before surfacing SQL errors.
  • Extend frontend and smoke tests to cover the new theming and messaging behavior.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/frontend/queryUi.test.tsx Adds unit coverage for preserving streamed messages before a later query error; updates Object Explorer test expectations for per-row styling.
tests/frontend/objectExplorerStyles.test.ts Adds a Node test that boots a Vite fixture + Playwright to validate computed Object Explorer styling and accessibility behavior.
tests/frontend/fixtures/objectExplorerStyles.tsx Fixture app wiring/stores for the Object Explorer styling test scenario.
tests/frontend/fixtures/objectExplorerStyles.html HTML entrypoint for the Object Explorer styling fixture.
src/index.css Introduces row-scoped Object Explorer profile CSS (background/foreground, hover, selection, forced-colours outline).
src/features/explorer/components/TreeNode.tsx Applies per-row profile styling via CSS variables and a dedicated class; uses passed connection/profile info.
src/features/explorer/components/ObjectExplorerTree.tsx Stops tinting the explorer shell; resolves profile/connection per node and passes down to TreeNode.
sidecar/tests/Ssmsx.Core.Tests/Query/QueryExecutorTests.cs Adds tests for affected-row message formatting (negative/0/1/N).
sidecar/src/Ssmsx.Core/Query/QueryExecutor.cs Emits affected-row messages from StatementCompleted and flushes messages before rethrowing SQL errors.
scripts/smoke-sidecar.mjs Expands smoke coverage for affected-row messaging, ordering with PRINT, NOCOUNT suppression, and error ordering.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/index.css
Comment thread tests/frontend/objectExplorerStyles.test.ts

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4dcb34f176

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tests/frontend/objectExplorerStyles.test.ts
@GordonBeeming
GordonBeeming requested a lite review from Copilot August 5, 2026 02:44
@GordonBeeming

Copy link
Copy Markdown
Owner Author

@codex review

@GordonBeeming

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 5, 2026 •

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated no new comments.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: 7fecc1f509

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@GordonBeeming
GordonBeeming marked this pull request as ready for review August 5, 2026 03:02
@GordonBeeming
GordonBeeming merged commit 593aa56 into main Aug 5, 2026
8 checks passed
@GordonBeeming
GordonBeeming deleted the gb/fix-connection-colours-row-counts branch August 5, 2026 03:03
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