Skip to content

feat(joint-core): add Paper.getCellView() for strict view lookup#3377

Open
kumilingus wants to merge 1 commit into
clientIO:masterfrom
kumilingus:feat/paper-get-cell-view
Open

feat(joint-core): add Paper.getCellView() for strict view lookup#3377
kumilingus wants to merge 1 commit into
clientIO:masterfrom
kumilingus:feat/paper-get-cell-view

Conversation

@kumilingus

Copy link
Copy Markdown
Contributor

Summary

  • New public method paper.getCellView(cellOrId) returning the real CellView if instantiated, null otherwise.
  • Unlike findViewByModel, it does NOT resolve view placeholders and does NOT schedule view updates — pure lookup.
  • Adopt internally in pointermove / pointerup handlers, where the cached sourceView is only being probed for liveness mid-drag (no reason to force-resolve a placeholder).
State findViewByModel getCellView
No entry undefined null
Real CellView exists the view the view
Placeholder only resolves + view null
Side effect schedules update none

Motivation: consumers (joint-react cleanup paths, downstream apps) need to ask "do we already have a rendered view for this cell?" without inadvertently materializing a placeholder. Today the only options are findViewByModel (side-effectful) or reaching into private paper._views[id].

Test plan

  • yarn lint clean
  • yarn test-ts clean
  • karma:joint — 1984/1984 pass (new paper.getCellView() QUnit module covering instantiated cell, unknown id, and placeholder-only paths via viewport: () => false + viewManagement: { lazyInitialize: true })

🤖 Generated with Claude Code

Side-effect-free counterpart to findViewByModel: returns the real
CellView if instantiated, null otherwise. Does not resolve view
placeholders and does not schedule view updates.

Adopt in Paper pointermove/pointerup handlers — the cached sourceView
liveness check has no reason to resolve a placeholder mid-drag.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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.

1 participant