`Page: Delete` weird redirect behaviour

(On latest edge) I face weird behaviour when using the Page: Delete command. With this button:

   {
      icon = 'trash',
      run = function()
        editor.invokeCommand 'Page: Delete'
      end,
      description = 'Delete page'
    },

and only from time to time (sic!) when I delete some page I am currently in, I am redirected to CONFIG instead to the index page (that is customized to Home page using the SB_INDEX_PAGE='Home' environment variable).

Does anyone also hit this behaviour?

I have had the same issue when using the Delete Page command from the command picker, but it would take me to a page other than CONFIG.

I never got round to raising a GitHub issue.

It tries to take you to a recently opened page, tho I‘m unsure how that logic is implemented specifically

That makes sense but the implementation was/(is?) broken - I remember I had set a custom index page and it would take me elsewhere when I expected it to redirect me to the index.

I might’ve just been expecting different behaviour though

I also noticed weird behavior here. In principle it tries to open the most recently opened page: silverbullet/plugs/editor/page.ts at main ¡ silverbulletmd/silverbullet ¡ GitHub

But I’m not 100% sure this list of recently opened pages is properly maintained. Could you create a github issue for this?

Yeah, it doesn’t seem to filter out pages which weren’t recently opened. So if there are no recent pages, it will take you to a “random” one.

Issued.

1 Like