metabase / metabase/metabase

Browser back after opening the New embed modal leaves the embedding admin page

Open
#82,255 1 comment 0 reactions 0 assignees View on GitHub
.Needs Triage .Team/Embedding Priority:P3 Type:Bug
Dominant language
Clojure
Stars
49.3k
Forks
6.8k
Avg merge
1d 13h
Merged PRs (30d)
653

Description

### Describe the bug

Opening the **New embed** modal does not add a browser history entry, so pressing back does not close it — it navigates out of the embedding admin page to whatever page came before it.

The modal is opened by dispatching Redux state (`setOpenModalWithProps({ id: "embed" })`) rather than by routing, so the top of the history stack is still the page you came from. Every entry point behaves the same way: the New embed button in embedding settings, the setup guide, the sharing menu, and the command palette.

### To Reproduce

1. Go to **Admin → Embedding** from another page, e.g. a dashboard.
2. Click **New embed**.
3. Press the browser back button.

You land on the page from step 1 instead of back on the embedding admin page with the modal closed.

### Expected behavior

Back closes the modal and leaves you on the embedding admin page you opened it from.

### Information about your Metabase installation

`master` @ 6431bc412b2223a7905876a5e23f322f22624b76 (development build, 2026-09-09). Not edition-specific.

### Severity

Annoying. Nothing is lost — the embed being configured is discarded, but nothing was saved yet — and the modal can still be closed with its own close button. It is a surprising exit from a section the user was working in.

### Additional context

Pre-existing behavior — it reproduces on 63.

The same thing happens in the embedding hub, whose left-nav New embed button dispatches the same action, but the hub is not merged yet (metabase/metabase#80336), so this issue is about the embedding admin page.

Fixing it means giving the embed modal its own URL, so that opening it pushes a history entry and back pops it. The tenants routes already do this with `modalRoute(...)`; each entry point would navigate to that route instead of dispatching the Redux action.

Contributor guide

Open the contributing guide

Research direction

Start with the New embed entry points in embedding settings, the setup guide, the sharing menu, and the command palette, then compare the tenants routes that use modalRoute(...). Replace the Redux-only opening path with the embed modal route so browser Back closes the modal and keeps the embedding admin page open.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
64/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.