Follow mid-edit renames to Markdown in the "Preview" tab

What does this MR do and why?

Resolves "Preview" tab does not follow mid-edit file ren... (#616115 - closed), focusing on the preview selection.

Switch the "Preview" tab between the Markdown live preview and the rendered preview pane based on the Markdown extensions currently loaded in the editor, rather than the state captured at page load. The loaded extensions follow mid-edit renames, so the tab choice does too.

Scope

Making the preview renderer follow renames is covered in Follow mid-edit renames in the preview renderer (!251790 - merged).

🔴 RED → 🟢 GREEN cycles:

  1. Add a spec asserting the "Preview" tab opens the Markdown live preview after a rename to Markdown — 🔴 RED at this point due to the existing bug (job log)
  2. Switch the pane based on the currently loaded Markdown extensions instead of the page-load isMarkdown option, turning it 🟢 GREEN.

Screen recordings

Manually verified in GDK-in-a-box:

How to set up and validate locally

  1. In a repository, create a file named foo.rst with some reStructuredText content and commit it
  2. Open foo.rst in the single file editor
  3. Rename it to foo.md and write some Markdown content
  4. Click the "Preview" tab
  5. Verify that the content is rendered with the Markdown live preview

Notes

  • I don't work on the frontend regularly — a careful look at this approach would be very helpful.

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by skkzsh

Merge request reports

Loading
Loading