Skip to content

Colour Object Explorer and editor gutter - #91

Merged
GordonBeeming merged 4 commits into
mainfrom
gb/connection-surface-backgrounds
Aug 4, 2026
Merged

GordonBeeming merged 4 commits into
mainfrom
gb/connection-surface-backgrounds

Conversation

@GordonBeeming

@GordonBeeming GordonBeeming commented Aug 4, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • I apply the selected tree node's connection profile to the Object Explorer background and text.
  • I apply the active query's connection profile to the line-number gutter without colouring the editor canvas or horizontal bars.
  • I added DOM coverage with a dark custom profile to check the background and foreground pair.

Test plan

  • npm run test:frontend
  • npm run build
  • dotnet test sidecar/Ssmsx.Sidecar.slnx --filter 'Category!=Integration'
  • cargo test --manifest-path src-tauri/Cargo.toml

Summary by CodeRabbit

  • New Features

    • Connection-specific color profiles now apply consistently to the object explorer, query editor gutters, and query results.
    • Explorer headings, empty states, and editor gutter text automatically reflect the selected connection’s colors.
  • Bug Fixes

    • Improved visual consistency across connection-specific interface elements.
  • Tests

    • Added coverage verifying profile-based colors in the query editor and object explorer.

@coderabbitai

coderabbitai Bot commented Aug 4, 2026 •

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 9be07712-4ace-4733-a64a-174d876dfd5c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Changes

Connection profile styling

Layer / File(s) Summary
Object explorer profile rendering
src/features/explorer/components/ObjectExplorerTree.tsx, src/index.css, tests/frontend/queryUi.test.tsx
The explorer resolves the selected connection profile and applies background, foreground, CSS variables, and profiled text styles. Tests cover the selected server profile.
Query profile propagation and styling
src/features/query/components/QueryEditor.tsx, src/features/query/components/QueryPanel.tsx, src/index.css, tests/frontend/queryUi.test.tsx
QueryPanel shares the active profile with the editor and results table. QueryEditor applies gutter CSS variables, and tests verify the values.
Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant SelectedConnection
  participant QueryPanel
  participant QueryEditor
  participant QueryResultsTable
  participant ObjectExplorerTree
  SelectedConnection->>QueryPanel: provide active connection
  QueryPanel->>QueryPanel: resolve color profile
  QueryPanel->>QueryEditor: pass gutter colors
  QueryPanel->>QueryResultsTable: pass active profile
  SelectedConnection->>ObjectExplorerTree: provide selected node connection
  ObjectExplorerTree->>ObjectExplorerTree: apply profile colors
Loading

Possibly related PRs

Suggested reviewers: copilot

🚥 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 and concisely describes the main changes to the Object Explorer and editor gutter colors.
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/connection-surface-backgrounds

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

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 extends connection color profiling to additional UI surfaces: the Object Explorer pane and the query editor’s line-number gutter, while keeping the editor canvas and other Monaco chrome unstyled. It also adds DOM-level test coverage for these profile-driven styles using a dark custom profile.

Changes:

  • Apply the selected Object Explorer node’s connection profile to the explorer pane background and text.
  • Apply the active query tab’s connection profile to the Monaco gutter (margin + line numbers) via CSS variables and scoped selectors.
  • Add frontend DOM tests to verify gutter-only styling and Object Explorer background/foreground styling.

Reviewed changes

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

Show a summary per file
File Description
tests/frontend/queryUi.test.tsx Adds DOM coverage to assert query gutter CSS variables and Object Explorer inline background/foreground derived from the selected/active connection profile.
src/index.css Adds scoped Monaco CSS overrides to color only the gutter margin and line numbers when profiling is enabled.
src/features/query/components/QueryPanel.tsx Resolves the active connection’s color profile once and passes gutter colors to QueryEditor (and reuses the profile for results).
src/features/query/components/QueryEditor.tsx Introduces CSS-variable-driven gutter styling by wrapping Monaco in a profiled container and exposing gutterBackground/gutterForeground props.
src/features/explorer/components/ObjectExplorerTree.tsx Derives the selected node’s connection profile and applies its background/foreground (and text CSS vars) to the explorer pane container.

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

@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: a29dc46ad5

ℹ️ 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 src/features/explorer/components/ObjectExplorerTree.tsx Outdated
Address reviewer comments:
- Scope Object Explorer profile foreground to profiled surfaces
@GordonBeeming
GordonBeeming requested a lite review from Copilot August 4, 2026 09:42
@GordonBeeming

Copy link
Copy Markdown
Owner Author

@codex review

@GordonBeeming

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 4, 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.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: d1fedac8cc

ℹ️ 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".

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 5 out of 5 changed files in this pull request and generated no new comments.

Suppressed comments (2)

src/index.css:49

  • In profiled mode this hover rule overrides TreeNode’s hover:bg-* styling (and hover text-color changes are also overridden by the profiled foreground rule), resulting in no visible hover feedback for non-selected items. This is a usability/accessibility regression because users lose a key affordance for what they’re pointing at.
.object-explorer-profiled [role="treeitem"]:not([aria-selected="true"]):hover {
  background-color: var(--object-explorer-background);
}

src/features/query/components/QueryEditor.tsx:129

  • The query-editor-profiled class is currently toggled only by gutterBackground. If a caller ever provides only gutterForeground (or if a future profile omits background), the gutter CSS won’t apply even though the CSS variables are set. Making the condition depend on either variable keeps this component’s API robust and self-consistent.
    <div
      data-testid="query-editor"
      className={`h-full ${gutterBackground ? "query-editor-profiled" : ""}`}
      style={editorStyle}
    >

Address reviewer comments:
- Restore profiled tree hover affordance
- Activate gutter styling for either supplied colour
@GordonBeeming
GordonBeeming requested a lite review from Copilot August 4, 2026 09:49
@GordonBeeming

Copy link
Copy Markdown
Owner Author

@codex review

@GordonBeeming

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 4, 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.

@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: 036c12d3c3

ℹ️ 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 src/index.css Outdated

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 5 out of 5 changed files in this pull request and generated no new comments.

Address reviewer comments:
- Preserve profile contrast during tree-row hover
@GordonBeeming
GordonBeeming marked this pull request as ready for review August 4, 2026 10:33
Copilot AI review requested due to automatic review settings August 4, 2026 10:33
@GordonBeeming
GordonBeeming merged commit 0edbf2c into main Aug 4, 2026
8 checks passed
@GordonBeeming
GordonBeeming deleted the gb/connection-surface-backgrounds branch August 4, 2026 10:34

@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: 52b45fad36

ℹ️ 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 src/index.css
Comment on lines +41 to +44
.object-explorer-profiled [role="treeitem"],
.object-explorer-profiled [role="treeitem"] button,
.object-explorer-profiled .object-explorer-profiled-text {
color: var(--object-explorer-foreground);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep the selected row on the validated background

When a custom profile is near the accepted 4.5:1 threshold, this selector applies its foreground to the selected tree item while TreeNode still overlays bg-accent/15 on that item's background. For example, the accepted #FFFFFF/#767676 pair becomes roughly #D9E8F3/#767676 on the selected row, only about 3.63:1, so selecting the node that activates the profile immediately defeats the validation guarantee. Preserve the profile background for selected rows or use a non-background selection indicator.

Useful? React with 👍 / 👎.

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 6 out of 6 changed files in this pull request and generated no new comments.

Suppressed comments (2)

src/features/explorer/components/ObjectExplorerTree.tsx:97

  • "--object-explorer-background" is set on the explorer container, but no CSS consumes it (only "--object-explorer-foreground" is referenced). Setting unused custom properties makes future styling changes harder to reason about and can mislead readers into thinking it has an effect.
    width: explorerWidth,
    backgroundColor: selectedProfile?.background,
    color: selectedProfile?.foreground,
    "--object-explorer-background": selectedProfile?.background,
    "--object-explorer-foreground": selectedProfile?.foreground,

src/features/explorer/components/ObjectExplorerTree.tsx:29

  • The custom CSS variable "--object-explorer-background" is declared but not used anywhere in the codebase, which adds dead API surface and makes it harder to tell which styling hooks are actually supported. Either remove it, or add a concrete consumer of the variable.

This issue also appears on line 93 of the same file.

interface ObjectExplorerStyle extends CSSProperties {
  "--object-explorer-background"?: string;
  "--object-explorer-foreground"?: string;
}

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