Skip to content

[Grida Canvas] "Back to contents" feature #369

@softmarshmallow

Description

@softmarshmallow

In a infinite canvas, user can easly get lost with there current location, with panning.
"Back to contents" enables user to go back to contents area.

As this is a flavoured feature, it would be nice to be placed within the surface area or as a plugin.

[Checking "Outside"]
This would monitor the user's viewport rect, scan [visible] contents within the rect. (debounced)
This can be expensive, yet we don't have a R-Tree scanning anywhere, we would need one to make it performant.

While working on a R-Tree, the tree should be able to represent a AABB as in 'cliped' rectangle, so It would not process the invisible / nested clipped items (or this could be unessesry as there is no clear benefits / hard to implement)

[Going "Back"]
When user is "outside" of the content area, within exceeding the treshold, user should be focused back to the content area, where we define the "content area" can vary.

  1. The entire BB of entire content
  2. The entire BB, but within the current zoom level (if the BB is larger than tne viewport), to the center or the nearest sub BB with margins
  3. The reasonably closest "dense" area BB - guess we'll need to invent a math for this. no-op.

Fitting back to content will be centered aligned by default, having a default UX config of the min/max zoom level, preventing user to zoom-out-or-in in a extreme level.

[Exceptions]
This feature would only be active there are visible root nodes. (obviously, there is no place to go back if there is no content in the first place)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions