Skip to content

Show a different Object Explorer icon for NOT NULL columns. #5827 - #10863

Merged
dpage merged 1 commit into
pgadmin-org:masterfrom
dpage:fix/issue-5827-not-null-column-icon
Nov 27, 2026
Merged

dpage merged 1 commit into
pgadmin-org:masterfrom
dpage:fix/issue-5827-not-null-column-icon

Conversation

@dpage

@dpage dpage commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • NOT NULL columns now show the column icon with a red padlock in the Object Explorer, using the SVG @adityatoshniwal proposed on the issue, added as column-not-null.svg with an icon-column-not-null class (registered the same way as the table inheritance icon variants).
  • The nodes, create and update endpoints all pick the icon from attnotnull, so the icon changes when NOT NULL is added or dropped; create and update re-read the column, since identity columns and primary keys make a column NOT NULL implicitly.
  • There is no separate primary key column icon today, so primary key columns, being NOT NULL, get the new icon too. Foreign table columns share this view and get it as well; their existing icon is byte-for-byte the same as the table column icon.

Icons are not theme-specific in pgAdmin, so the same SVG is used in the light, dark and high-contrast themes.

Test plan

  • Column node tests now assert the icon for nullable and NOT NULL columns from nodes, create and update; columns (55) and foreign_table_columns (13) packages pass on PostgreSQL 18, and the new assertions fail if the icon logic is broken.
  • pycodestyle clean.

Closes #5827

Summary by CodeRabbit

  • New Features
    • Column icons now distinguish columns that require a value from standard columns, including in column creation, updates, and listings.

…rg#5827

Columns with a NOT NULL constraint now use the column icon with a padlock
marker, as proposed on the issue, so they can be picked out in the tree
without opening the column's properties. The nodes, create and update
endpoints all choose the icon from attnotnull, so the icon follows the
column when NOT NULL is added or dropped.

Closes pgadmin-org#5827
@dpage dpage self-assigned this Nov 26, 2026
@coderabbitai

coderabbitai Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Column node responses now use a distinct icon for columns with a NOT NULL constraint. Creation and update responses select the icon from the current database state. Tests verify the icons returned for standard and NOT NULL columns.

Changes

Column icon selection

Layer / File(s) Summary
Icon styling and node listings
web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/__init__.py, web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/test_column_get_nodes.py
A column-specific CSS snippet supports the NOT NULL icon. Single-node and collection responses choose icons from each row’s not_null value. Tests check standard and NOT NULL column icons.
Creation and update response icons
web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/__init__.py, web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/*
Creation and update responses query the current column state to select the icon. If the query fails or returns no rows, the response uses the standard icon. Tests assert the expected icons for successful creation and update cases.

Estimated code review effort: 2 (Simple) | ~12 minutes

Change: Feature · Severity of issue fixed: Low

Merge Risk: Minimal · up to 0fbd5 · assessed changes only

Path filters excluded changed files. This rating applies only to the assessed changes.

Pre-merge checks: Passed 3 · Inconclusive 1

Failed Failed checks: 1 inconclusive

Check name Status Explanation Resolution
Linked Issues check Inconclusive Issue #5827 asks for a visible mark on NOT NULL column icons in the Object Explorer tree. The reviewable code implements the selection logic. The nodes, create, and update endpoints choose `icon… Provide independent evidence that column-not-null.svg renders a visible mark over the standard column icon. Examples are a rendered screenshot of the Object Explorer with a NOT NULL column, or a reviewer confirmation of the SVG content fr…
Passed Passed checks: 3 passed

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the main change: NOT NULL columns in Object Explorer get a different icon. The raw summary confirms this. ColumnsView picks a NOT NULL or standard icon from the not_null value, and the…
Out of Scope Changes check Passed All reviewable changes relate to the #5827 objective. The ColumnsModule CSS snippet and the ColumnsView icon helpers add the NOT NULL icon class and select it. The nodes, create, and update …
Full details: Title check

Explanation

The title names the main change: NOT NULL columns in Object Explorer get a different icon. The raw summary confirms this. ColumnsView picks a NOT NULL or standard icon from the not_null value, and the tests assert icon-column versus icon-column-not-null. The title matches the linked issue #5827 and the PR objectives. It does not mention the create/update re-read or the foreign-table columns, which is acceptable for a short title.

Full details: Out of Scope Changes check

Explanation

All reviewable changes relate to the #5827 objective. The ColumnsModule CSS snippet and the ColumnsView icon helpers add the NOT NULL icon class and select it. The nodes, create, and update icon selection covers the NOT NULL state. Primary key and identity columns are NOT NULL, so they receive the same icon. Foreign table columns share the same view and receive the same icon, which is expected behavior for the shared column node. The test changes in column_test_data.json, test_column_add.py, test_column_get_nodes.py, test_column_put.py, and tests/utils.py assert the icon behavior. These changes support the objective. No unrelated change was found in the summarized diff.

Full details: Linked Issues check

Explanation

Issue #5827 asks for a visible mark on NOT NULL column icons in the Object Explorer tree. The reviewable code implements the selection logic. The nodes, create, and update endpoints choose icon-column-not-null from attnotnull. ColumnsModule.csssnippets adds the matching CSS class. Create and update re-read the column, so implicit NOT NULL (identity and primary key columns) is covered. Tests assert the icon for nullable and NOT NULL columns. The visible mark itself is defined in web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/static/img/column-not-null.svg. This file matches the excluded rule !**/*.svg and its content was not reviewed. The PR description states that it contains a red padlock. That statement is not independent evidence of the rendered result. The requirement that the icon shows a mark therefore depends on an excluded file. This verdict cannot be confirmed from reviewable evidence.

Resolution

Provide independent evidence that column-not-null.svg renders a visible mark over the standard column icon. Examples are a rendered screenshot of the Object Explorer with a NOT NULL column, or a reviewer confirmation of the SVG content from a source outside the excluded rule. No code change is required for the logic that is already reviewable.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 3b6b9b2 and 0fbd5eb.

Files ignored due to path filters: 1

  • web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/static/img/column-not-null.svg is excluded by !**/*.svg
Files selected for processing: 6

  • web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/__init__.py
  • web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/column_test_data.json
  • web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/test_column_add.py
  • web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/test_column_get_nodes.py
  • web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/test_column_put.py
  • web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/tests/utils.py

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 0 remain after this review.

@dpage
dpage merged commit 2c9c4f6 into pgadmin-org:master Nov 27, 2026
32 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.

Different icon for not-null columns

1 participant