Skip to content

Apply server foreground colour to object counts (#9766)#10041

Merged
asheshv merged 3 commits into
pgadmin-org:masterfrom
dpage:fix-9766-fgcolor-counts
Jun 12, 2026
Merged

Apply server foreground colour to object counts (#9766)#10041
asheshv merged 3 commits into
pgadmin-org:masterfrom
dpage:fix-9766-fgcolor-counts

Conversation

@dpage

@dpage dpage commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #9766.

A server's custom foreground colour was applied to node labels (span.file-name) but not to the object counts shown next to collection nodes, so the counts stayed the default colour and could be hard to read against the server background colour.

Fix: include span.children-count in the per-server fgcolor CSS rule in change_server_background.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Fixed an issue where custom server foreground colors were not applied consistently in the object explorer; object counts (children counts) and column type labels now honor the server's configured foreground color for consistent theming across the interface.

@coderabbitai

coderabbitai Bot commented Jun 9, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

Pull request was closed or merged during review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 16cf5737-1386-4e29-bc4c-9e283908087e

📥 Commits

Reviewing files that changed from the base of the PR and between 52b5915 and 038ab27.

📒 Files selected for processing (1)
  • docs/en_US/release_notes_9_16.rst
✅ Files skipped from review due to trivial changes (1)
  • docs/en_US/release_notes_9_16.rst

Walkthrough

This PR extends the dynamic CSS in change_server_background to apply a server’s configured foreground color to object explorer children counts, and adds a v9.16 release notes entry documenting Issue #9766.

Changes

v9.16 Release Notes and Foreground Color Fix

Layer / File(s) Summary
Children count foreground color styling
web/pgadmin/browser/static/js/node.js
Dynamic CSS generated by change_server_background is extended to apply server foreground color (fgcolor) to span.children-count elements alongside existing span.file-name variants within the .file-label scope.
Release notes bug fix entry
docs/en_US/release_notes_9_16.rst
v9.16 release notes bug fixes section documents Issue #9766 fix: foreground color now applied to object counts and column type labels in the object explorer.

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 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 change: applying server foreground colour to object counts, and includes the issue number for reference.
Linked Issues check ✅ Passed The code changes successfully address the requirements in issue #9766 by applying server foreground colour to both collection counts and column types as specified.
Out of Scope Changes check ✅ Passed All changes are directly related to fixing issue #9766; the release notes update and CSS modification are both within scope for this fix.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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 and usage tips.

@dpage dpage force-pushed the fix-9766-fgcolor-counts branch 2 times, most recently from 434e6fa to 5692e06 Compare June 9, 2026 11:36
The per-server dynamic style only set the foreground colour on
span.file-name, so the collection "children count" (span.children-count)
did not follow the configured foreground colour. Include
span.children-count in the fgcolor rule.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

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

Updates pgAdmin’s browser tree styling so per-server foreground colours apply consistently, improving readability of labels and adjacent metadata in the object explorer.

Changes:

  • Extend the per-server foreground-colour CSS rule in change_server_background to also style collection object counts.
  • Add a v9.16 release note entry referencing Issue #9766.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
web/pgadmin/browser/static/js/node.js Updates dynamic per-server CSS selectors so the configured foreground colour also applies to counts shown next to collection nodes.
docs/en_US/release_notes_9_16.rst Documents the fix in the v9.16 bug fixes section.

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

Comment thread web/pgadmin/browser/static/js/node.js
…rg#9766)

Issue pgadmin-org#9766 asked for both the object counts and the column type text
to follow the server's custom foreground colour. The dynamic per-server
CSS rule only recoloured the file-name and children-count spans, leaving
the column type text (span.text-muted) at its default low-contrast
colour.

Recolour span.text-muted to a reduced-emphasis blend of the foreground
colour using color-mix, so the datatype still reads as de-emphasised
secondary text while following the server colour.

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@web/pgadmin/browser/static/js/node.js`:
- Around line 748-750: The dynamic CSS rule .${dynamic_class} span.text-muted
uses color-mix() which isn’t supported by older browsers; add a fallback color
declaration before the color-mix line (e.g., a precomputed rgba/opacity value
derived from ${fgcolor}) and/or wrap color-mix in an `@supports` (selector:
color-mix) block so browsers fall back to the rgba; also verify that the
selector .${dynamic_class} span.text-muted actually targets the column type
labels referenced in Issue `#9766` and, if those labels use a different
element/class, update the selector to match the real DOM element.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: e378c805-f533-486d-a76b-5b12b31addb6

📥 Commits

Reviewing files that changed from the base of the PR and between cf17385 and 52b5915.

📒 Files selected for processing (2)
  • docs/en_US/release_notes_9_16.rst
  • web/pgadmin/browser/static/js/node.js
✅ Files skipped from review due to trivial changes (1)
  • docs/en_US/release_notes_9_16.rst

Comment thread web/pgadmin/browser/static/js/node.js

@asheshv asheshv left a comment

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.

LGTM, with one small follow-up. The selector and color-mix() usage match the existing convention in reactaspen.override.js.

One gap worth fixing in this PR or a follow-up: the new rule has no :hover / .pseudo-active variant for span.children-count, so on hover the count snaps to the theme textHoverFg while the label keeps the user's custom colour. Mirroring the :hover block already added for file-name would close that inconsistency.

@asheshv asheshv merged commit ba60f0a into pgadmin-org:master Jun 12, 2026
33 of 34 checks passed
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.

Foreground color not consistent

3 participants