Skip to content

Update Entities Visualizer#8783

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

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

Conversation

@yusufkinatas
Copy link
Copy Markdown
Collaborator

@yusufkinatas yusufkinatas commented May 28, 2026

🌟 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
Copy link
Copy Markdown

vercel Bot commented May 28, 2026

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

Project Deployment Actions Updated (UTC)
hash Ready Ready Preview, Comment May 29, 2026 6:48am
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
hashdotdesign-tokens Ignored Ignored Preview May 29, 2026 6:48am
petrinaut Skipped Skipped May 29, 2026 6:48am


if (!propertyColumnsMap.has(baseUrl)) {
const width = getTextWidth(propertyType.title) + 85;
const width = getTextWidth(propertyType.title) + 100;
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

drive-by UI fix for not enough padding on the conversion units on data property types (meters / inches etc)

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
Copy link
Copy Markdown

augmentcode Bot commented May 28, 2026

🤖 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 👎

Copy link
Copy Markdown

@augmentcode augmentcode Bot left a comment

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" },
Copy link
Copy Markdown

@augmentcode augmentcode Bot May 28, 2026

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
Collaborator 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
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.

1 participant