Skip to content

notebook: Add notepad CTA to empty notebook pages

Administrator requested to merge fkling/notepad-cta into main

Created by: fkling

This PR adds a notepad CTA to empty notebooks. The current behavior is:

  • If the CTA is closed or the notepad is enabled, the CTA is never shown again.
  • If notepad has been enabled before, the CTA is not shown.
  • Adding any content to the notebook will hide the CTA (but the CTA will be shown again if the same (or a new notebook) is empty).

The last point is probably debatable. I didn't intentionally implement it this way, that's a side effect of how the component works and the most simple implementation to make the CTA work.

To position the CTA properly I simply added it after the spacer that already existed (making the spacer a little smaller). This ensures that the CTA is shown further down the page as long as space is available, but it won't cover any notepad content.

https://user-images.githubusercontent.com/179026/165165905-3c52057c-3fcc-4add-80c5-098f043d4b98.mp4

Test plan

Manual testing.

  • Clicking the close button removes the CTA and refereshing the (empty) notebook doesn't show it again.
  • Clicking the "Enable notepad" button shows the notepad and hides the CTA.
  • Resizing the window (height) adjusts the position of the CTA accordingly and will cause the main column to overflow/scroll if there is not enough space.

App preview:

Check out the client app preview documentation to learn more.

Merge request reports

Loading