Can't change block type using command

Describe the bug

When trying to change the type of an existing block using commands (/toggle, /h1 etc), the first X chars are cut from the block. (see bottom for X).

All works fine if we use the Turn into dialog on the left of the blocks.

To Reproduce

Steps to reproduce the behavior:

    1. Open a page
    1. Enter text into a block
    1. Change the type of the block using a command (with the command not at the end of the block)

Expected behavior

Change the current block type (same as Turn into dialog)

Desktop (please complete the following information):

  • OS: macOS 11.0.1
  • Device: MacBook Pro
  • Version: 0.16.8

Additional context

Number of chars cut: so after some testing seems like it cuts the X first chars from the block, where X is the length of the command you typed (including /).

ie if the block is 123456 and you type:

  • /h1 then press enter, you’ll be left with 456
  • /hea then press enter (with header element again), you’ll be left with 56

The chars are cut from where you enter the command, so /h1123456 -> 456, 12/h13456 -> 12.

Edit: after some further testing, the command seems to be creating a new block instead of changing the type of the current block, is this the way it’s supposed to be?

INVALIDUPLOAD 453bcb86-48c5-4fee-a953-6d7653c01fa0 is missing from database—command.mp4

1 Like

Yes, it works just the same on Notion. This is not a bug.

Any reason for not being able to turn into using the keyboard?

For example only triggering the transformation if performed on the very beginning.

@lukasmoertl People create a new block much more often than they turn a type of block into something else. There is generally no need for it, though, if there is a necessity, it should be different than creating a new block. Users could type /turn first.

@hayk It’s the correct behavior of the application. When you type /smth, you open the add block menu. When you choose a block and press enter, you create a block on the same level as the block where you put it like at the beginning of your video.

1 Like

@hayk @lukasmoertl I can just add one thing. You can use CMD + / or Ctrl + / to launch turn into menu, write the desired block in the filter, and press Enter. You can even select several blocks and do that. So you won’t be distracted from using keyboard

2 Likes

@vova_ermolaev Oh awesome! CMD/Ctrl + / seems to be the functionality i’m looking for. Thanks guys!

It’s clear typing “/smth” creates a new block and it’s the desired outcome, but what about the deleting of existing characters? @hayk explained this in the original post. This does not happen in Notion - i.e. if you have a block with “123456789” and you type “/h1” anywhere inside of it, a new header is created and the previous block stays the same.

Should we report this as a separate bug?

2 Likes

@Tymoteusz It’s not a bug. If you want this behavior in Anytype, please, write about it in feature-requests