Skip to content

H-4819: entity links pagination#8886

Open
alex-e-leon wants to merge 35 commits into
mainfrom
H-4819-entity-links-pagination
Open

H-4819: entity links pagination#8886
alex-e-leon wants to merge 35 commits into
mainfrom
H-4819-entity-links-pagination

Conversation

@alex-e-leon

@alex-e-leon alex-e-leon commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

🌟 What is the purpose of this PR?

Paginates links for entities when in readonly mode in hash-app. For now I've set the page limit to 200, and the pagination strategy is infinite scroll.

A couple more notes on my approach:

  • A lot of the data was being passed around through context, and I've switched it all to be passed as props instead. While I was trying to understand how the existing components worked, the context pattern made it really hard to understand where data was being set + updated + read. Before react-compiler this might not have been possible due to performance issues, but I don't see any performance impact even on very large datasets. @CiaranMn If you prefer though that I keep the old context approach let me know and I'll undo it.
  • There's a lot of existing complex logic around editable state/draft states/switching between entities within the same view etc. The new pagination logic adds an additional layer of complexity. I mostly gave up trying to understand all this complexity and just asked claude to handle it, so I'm not super proud of this code - but I can't really see any better approach to getting the logic right without a large refactor or just throwing more ai at it.

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

@vercel

vercel Bot commented Jun 19, 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 25, 2026 4:00pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
hashdotdesign-tokens Ignored Ignored Preview Jun 25, 2026 4:00pm
petrinaut Skipped Skipped Jun 25, 2026 4:00pm

@cursor

cursor Bot commented Jun 19, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Entity page load and link display behavior change across readonly vs editable paths and draft/permission edge cases; pagination and stale-completion handling add complexity but stay localized to the entity editor.

Overview
Readonly entity views no longer load all incoming/outgoing links in the main queryEntitySubgraph call. Link traversal is omitted until permissions return; if the user can edit, a second fetch adds full link data for the editor. If the entity is readonly, incoming/outgoing link sections load links themselves via cursor pagination (100 per page, infinite scroll) through new useEntityLinks and useAccumulatedCursorPagination, with totals and link-type filter options from separate summarize queries.

The monolithic LinksSection is removed; incoming/outgoing sections own data loading, link-type filtering (useLinkTypeFilter), loading/error states, and pass props into the virtualized tables instead of useEntityEditor. Editable mode still uses the full subgraph and the existing grid for outgoing links; readonly tables gain scroll-gated loadMore, server sort on outgoing link type where supported, and simplified client-side sort/filter elsewhere.

VirtualizedTable gains optional infinite-scroll hooks (onEndReached, onRangeChange, onIsScrolling, loadingMore). Global search caps entity/entity-type queries at 100 results. CRM seed data fixes pipeline stage default probability so Closed Won/Lost are 100%/0% and open stages ramp to 90%.

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

@github-actions github-actions Bot added area/apps > hash* Affects HASH (a `hash-*` app) area/apps > hash-api Affects the HASH API (app) type/eng > frontend Owned by the @frontend team type/eng > backend Owned by the @backend team area/apps labels Jun 19, 2026
Comment thread apps/hash-frontend/src/pages/shared/entity.tsx
@codecov

codecov Bot commented Jun 19, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 59.62%. Comparing base (fd129ea) to head (7db06fb).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
apps/hash-api/src/seed-data/seed-crm-data.ts 0.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8886      +/-   ##
==========================================
+ Coverage   59.61%   59.62%   +0.01%     
==========================================
  Files        1348     1348              
  Lines      131877   131754     -123     
  Branches     5944     5942       -2     
==========================================
- Hits        78615    78562      -53     
+ Misses      52357    52288      -69     
+ Partials      905      904       -1     
Flag Coverage Δ
apps.hash-api 0.00% <0.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread apps/hash-frontend/src/pages/shared/entity.tsx Outdated
Comment thread apps/hash-frontend/src/pages/shared/entity.tsx
@alex-e-leon alex-e-leon force-pushed the H-4819-entity-links-pagination branch from 16bf2b9 to 2ba37d6 Compare June 19, 2026 15:16
@vercel vercel Bot temporarily deployed to Preview – petrinaut June 19, 2026 15:16 Inactive
@vercel vercel Bot temporarily deployed to Preview – petrinaut June 19, 2026 15:22 Inactive
@vercel vercel Bot temporarily deployed to Preview – petrinaut June 19, 2026 15:24 Inactive
Comment thread apps/hash-frontend/src/pages/shared/entity.tsx
@vercel vercel Bot temporarily deployed to Preview – petrinaut June 19, 2026 15:30 Inactive
Comment thread apps/hash-frontend/src/pages/shared/entity.tsx Outdated
@vercel vercel Bot temporarily deployed to Preview – petrinaut June 19, 2026 15:33 Inactive
Comment thread apps/hash-frontend/src/pages/shared/entity.tsx
Comment thread apps/hash-frontend/src/pages/shared/entity/entity-editor.tsx Outdated
@alex-e-leon alex-e-leon mentioned this pull request Jun 24, 2026
2 tasks
CiaranMn
CiaranMn previously approved these changes Jun 25, 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 > hash-api Affects the HASH API (app) area/apps type/eng > backend Owned by the @backend team type/eng > frontend Owned by the @frontend team

Development

Successfully merging this pull request may close these issues.

2 participants