Skip to content

Improve indicators API #6395

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Improve indicators API #6395

wants to merge 3 commits into from

Conversation

steveruizok
Copy link
Collaborator

This PR solves a long-standing todo, which replaces the hard-coded list of "show indicators" to state nodes instead. As a result, we can remove the <TldrawShapeIndicators> component that provided that logic.

Change type

  • bugfix
  • improvement
  • feature
  • api
  • other

Release notes

  • SDK: Added shouldShowIndicators() to StateNode, used to configure whether indicators should be shown when in the state

Copy link

vercel bot commented Jul 4, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
analytics ✅ Ready (Inspect) Visit Preview Jul 4, 2025 7:34pm
examples ✅ Ready (Inspect) Visit Preview Jul 4, 2025 7:34pm
1 Skipped Deployment
Name Status Preview Updated (UTC)
tldraw-docs ⬜️ Ignored (Inspect) Visit Preview Jul 4, 2025 7:34pm

@huppy-bot huppy-bot bot added the api API change label Jul 4, 2025
Comment on lines 35 to 43
const path = editor.getPath()
const nodeIds = path.split('.')
for (let i = 0; i < nodeIds.length; i++) {
const subpath = nodeIds.slice(0, i).join('.')
const stateNode = editor.getStateDescendant(subpath)
if (!stateNode?.getShouldShowIndicators()) {
return prev
}
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The main new logic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api API change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant