Skip to content
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

Add an anchor system to SuperEditor widget #424

Open
matthew-carroll opened this issue Feb 11, 2022 · 1 comment
Open

Add an anchor system to SuperEditor widget #424

matthew-carroll opened this issue Feb 11, 2022 · 1 comment
Labels
area_super_reader Related to SuperReader area_supereditor Pertains to SuperEditor bounty_senior f:superlist Funded by Superlist time: 20 20 hours or less

Comments

@matthew-carroll
Copy link
Contributor

It should be easier than it is to display popover toolbars and other overlay anchored items.

Currently, developers need to provide a ScrollController to SuperEditor so that the developer can update the toolbar's location on every frame. This is very tedious and it's likely to fail when there's more separation between SuperEditor and the rest of the app behavior.

One idea that I have to deal with this is to pass a map of DocumentSelection -> LayerLink. The SuperEditor widget can maintain a set of invisible SizedBox widgets at the locations and sizes represented by the various DocumentSelections and those boxes can be wrapped in a LinkTarget.

Then, builder widgets could be used to easily anchor other widgets in the overlay.

SuperEditorAnchoredBuilder(
  link: _selectionLink,
  overlayBuilder: (context) {
    return EditorToolbar(
      editContext: editContext,
    );
  },
  child: SuperEditor(
     //...
     anchors: {
       // Place an invisible anchor around the user's selection
       _selectionLink: composer.selectionNotifier,
     },
  ),
);
@matthew-carroll matthew-carroll added area_supereditor Pertains to SuperEditor status_needs_analysis A maintainer needs to break down this ticket into action items. labels Feb 11, 2022
@jonaird
Copy link

jonaird commented Feb 13, 2022

Another issue I'm having that would need to be addressed by this system is that my toolbar is a bit large and it prevents the user from being able to scroll the document when the mouse is on top of the toolbar. This is because the toolbar isn't actually in the scrollable widget. afaik I don't think it's possible to collect raw scroll information?

Another use case is slash commands. For example in Notion, if you type "/h1" a filtered list of blocks shows up and hitting enter will create a new block of that type.

matthew-carroll added a commit that referenced this issue Jun 28, 2023
@matthew-carroll matthew-carroll added bounty_senior f:superlist Funded by Superlist area_super_reader Related to SuperReader time: 20 20 hours or less and removed status_needs_analysis A maintainer needs to break down this ticket into action items. labels Sep 8, 2023
matthew-carroll added a commit that referenced this issue Sep 26, 2023
…ystem (Resolves #424)

 - Applied floating cursor expanded selection fix from another PR. Fixed floating cursor auto-scroll bottom boundary position bug. Also debugging a floating cursor document
   mapping error when moving between nodes.
 - iOS controls configurability from outside Super Editor
 -  Moving complexity out of IosDocumentTouchInteractor. Currently trying to remove all possible dependencies on the shared and centralized IosDocumentGestureEditingController. All tests pass.
 - Removed a bunch of unneeded properties from IosDocumentTouchInteractor. All tests pass.
 - Refactored SuperReader to use new layer controls approach. All tests pass.
matthew-carroll added a commit that referenced this issue Oct 23, 2023
github-actions bot pushed a commit that referenced this issue Oct 23, 2023
matthew-carroll added a commit that referenced this issue Oct 23, 2023
dxvid-pts pushed a commit to dxvid-pts/super_editor that referenced this issue Feb 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area_super_reader Related to SuperReader area_supereditor Pertains to SuperEditor bounty_senior f:superlist Funded by Superlist time: 20 20 hours or less
Projects
None yet
Development

No branches or pull requests

2 participants