Skip to content

Update Entities Visualizer#8783

Open
yusufkinatas wants to merge 16 commits into
mainfrom
yk/update-entities-visualizer-final
Open

Update Entities Visualizer#8783
yusufkinatas wants to merge 16 commits into
mainfrom
yk/update-entities-visualizer-final

Conversation

@yusufkinatas

@yusufkinatas yusufkinatas commented May 28, 2026

Copy link
Copy Markdown
Contributor

🌟 What is the purpose of this PR?

Reworks the entities visualizer around a single, typed filter state and a redesigned header, and moves all filtering server-side.

🔗 Related links

🚫 Blocked by

  • Nothing

🔍 What does this change?

  • Introduces EntitiesFilterState and a pure buildEntitiesFilter that maps it to a Graph API Filter (web / type / archived clauses), replacing the old FilterState and all client-side column filters (webId, entityTypes, lastEditedById, createdById).
  • Replaces the shared TableHeader with a VisualizerHeader shell + FilterRibbon:
    • WebFilterPill — select internal webs / include other webs
    • TypeFilterPill — driven by useAvailableTypes, which fetches available types under the current web + archived filters but ignores the type filter itself (so unchecked types remain re-selectable)
    • IncludeArchivedPill + AddFiltersMenu
    • BulkActionsDropdown takes over the left slot when table rows are selected
  • Adds QueryCount to the header and drops the separate external-webs countEntities query / internal-vs-external count reconciliation; the result count now comes straight from the entity request.
  • Moves table-only controls into a new TableToolbar (CSV export via generateEntitiesCsvFile, search toggle, and a centralized SortControl).
  • Switches traversal paths per view via traversalPathsForView (graph view resolves links in/out of displayed entities; table/grid only resolve a link's own endpoints).
  • Resets the query cursor whenever sort, conversions, filter, or view change, to avoid paginating against stale results.
  • Shrinks EntitiesVisualizer's public props to { entityTypeBaseUrl?, entityTypeId?, hideColumns? }, removing defaultFilter, defaultGraphConfig, defaultGraphFilters, defaultView, fullScreenMode, hideFilters, loadingComponent, maxHeight, and readonly.

Pre-Merge Checklist 🚀

🚢 Has this modified a publishable library?

This PR:

  • does not modify any publishable blocks or libraries, or modifications do not need publishing

📜 Does this require a change to the docs?

The changes in this PR:

  • are internal and do not require a docs change

🕸️ Does this require a change to the Turbo Graph?

The changes in this PR:

  • do not affect the execution graph

⚠️ Known issues

🐾 Next steps

  • ...

🛡 What tests cover this?

None

❓ How to test this?

  1. Check out the branch and open an entities view (the Entities page, or a type's entities tab).
  2. Test all controls above the tables, filters, sorting, export, multi-selecting rows etc.

📹 Demo

Screenshot 2026-05-29 at 00 26 42 Screenshot 2026-05-29 at 00 26 49 Screenshot 2026-05-29 at 00 26 57 Screenshot 2026-05-29 at 00 27 04 Screenshot 2026-05-29 at 00 27 15

@vercel

vercel Bot commented May 28, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
hash Ready Ready Preview, Comment Jun 9, 2026 10:08am
hashdotdesign-tokens Ready Ready Preview, Comment Jun 9, 2026 10:08am
petrinaut Ready Ready Preview Jun 9, 2026 10:08am

yusufkinatas and others added 8 commits May 29, 2026 00:35
…e toolbar

Reorganize the entities visualizer around a single typed filter state
(EntitiesFilterState) with a pure buildEntitiesFilter mapping it to the
Graph API filter. Replace the shared TableHeader with a VisualizerHeader
shell that hosts a FilterRibbon (web pill, type pill, include-archived pill,
add-filters menu) on the left and QueryCount + view toggle on the right.
Bulk actions take over the left slot when rows are selected.

Move table-only actions (export, search, centralized sort) into a new
TableToolbar sub-header. Drop all client-side column filters (webId,
entityTypes, lastEditedById, createdById) so every filter is now server-side.
Switch traversal paths per view, fix cursor-reset on sort and conversions
changes, and shrink EntitiesVisualizer's public props to
{ entityTypeBaseUrl?, entityTypeId?, hideColumns? }.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@yusufkinatas yusufkinatas force-pushed the yk/update-entities-visualizer-final branch from fb400b6 to 9830e1b Compare May 28, 2026 21:35
@vercel vercel Bot temporarily deployed to Preview – petrinaut May 28, 2026 21:35 Inactive
@yusufkinatas yusufkinatas marked this pull request as ready for review May 28, 2026 21:36
@yusufkinatas yusufkinatas enabled auto-merge May 28, 2026 21:38
@augmentcode

augmentcode Bot commented May 28, 2026

Copy link
Copy Markdown
🤖 Augment PR Summary

Summary: Refactors the Entities Visualizer UI/data flow around a single typed filter state and moves filtering fully server-side.

Changes:

  • Introduce EntitiesFilterState + a pure buildEntitiesFilter to map UI state to Graph API Filter clauses (web/type/archived), replacing the prior FilterState and client-side column filters.
  • Replace the shared TableHeader with a new VisualizerHeader shell and FilterRibbon pills (web/type/include archived), plus a QueryCount derived from the entity query count.
  • Add a TableToolbar to host table-only controls: CSV export (generateEntitiesCsvFile), search toggle, and a centralized SortControl.
  • Adjust entity traversal behavior per view via traversalPathsForView (graph resolves link endpoints more broadly than table/grid).
  • Reset pagination cursor whenever sort, conversions, filter, or view changes to avoid paging stale result sets.
  • Shrink EntitiesVisualizer props to focus on pinned type inputs and column hiding.

Technical Notes: useEntitiesVisualizerData now queries queryEntitySubgraphQuery directly and useAvailableTypes performs an auxiliary query to populate type options independent of the active type filter.

🤖 Was this summary useful? React with 👍 or 👎

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

Review completed. 2 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

const graphViewTraversalPaths: TraversalPath[] = [
{
edges: [
{ kind: "has-left-entity", direction: "incoming" },

@augmentcode augmentcode Bot May 28, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

apps/hash-frontend/src/pages/shared/entities-visualizer/data/traversal-paths.ts:11 — The Graph traversal only follows incoming has-left-entity -> outgoing has-right-entity, which seems to resolve links where the displayed entity is the left endpoint but not where it’s the right endpoint. That looks inconsistent with the comment about resolving links “into and out of” displayed entities, and may cause some incoming links/endpoints to be missing in Graph view.

Severity: medium

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@CiaranMn this should be according to the requirements, right? Please resolve if so.

@vercel vercel Bot temporarily deployed to Preview – petrinaut May 29, 2026 05:07 Inactive
@github-actions github-actions Bot added area/tests New or updated tests area/tests > playwright New or updated Playwright tests labels May 29, 2026
@cursor

cursor Bot commented Jun 9, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Changes how entity lists are queried and filtered (including graph traversal), removes several embedder props, and alters graph view link resolution—incorrect filter mapping would show wrong entities or counts.

Overview
Reworks the entities visualizer around EntitiesFilterState and buildEntitiesFilter, so web, entity type, and archived constraints are sent to the Graph API instead of applied as in-grid column filters (web, type, created/last-edited by).

The shared TableHeader is replaced by VisualizerHeader: a FilterRibbon (web / type / include-archived pills, clear, add-filter) or BulkActionsDropdown when rows are selected, plus QueryCount and the view toggle. Type options come from useAvailableTypes (query without the type clause so deselected types stay pickable). Table-only actions move to TableToolbar (search, CSV export, SortControl). useEntitiesVisualizerData issues queryEntitySubgraph directly with view-specific traversalPathsForView (graph resolves link endpoints in/out; table/grid only outgoing link sides).

EntitiesVisualizer props are reduced to entityTypeBaseUrl, entityTypeId, and hideColumns; pagination cursor resets when filters, sort, conversions, or view change. The separate external-webs count query and internal/external count split are removed.

Reviewed by Cursor Bugbot for commit f1e18d8. Bugbot is set up for automated code reviews on this repo. Configure here.

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit f1e18d8. Configure here.

/**
* Hide the internal/external and archived filter controls
*/
hideFilters?: boolean;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stale web filter on membership

Medium Severity

filterState.web.selectedInternalWebIds is initialized once from internalWebIds and never updated when internalWebIds grows (for example after org membership loads). Server-side web filtering then omits new webs, so entities in newly joined org webs stay hidden until the user adjusts or clears filters.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit f1e18d8. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/apps > hash* Affects HASH (a `hash-*` app) area/apps area/tests > playwright New or updated Playwright tests area/tests New or updated tests type/eng > frontend Owned by the @frontend team

Development

Successfully merging this pull request may close these issues.

2 participants