Show "Maximize pane" in Rendered Markdown overflow menu#11258
Show "Maximize pane" in Rendered Markdown overflow menu#11258wzc520pyfm wants to merge 1 commit into
Conversation
…1256) The Markdown pane is implemented by two different views: `CodeView` backs the Raw mode, and `FileNotebookView` backs the Rendered mode. `CodeView::overflow_menu_items` exposes `MenuItemFields::toggle_pane_action` so the three-dot menu always offers a "Maximize pane" / "Minimize pane" entry, but `FileNotebookView::pane_header_overflow_menu_items` never wired the same entry. The result was an inconsistent overflow menu that let users maximize the pane in Raw mode but not in Rendered mode. Mirror the CodeView pattern in FileNotebookView: - add a `ToggleMaximized` action that emits `PaneEvent::ToggleMaximized` and refreshes the overflow menu so the label flips between "Maximize pane" and "Minimize pane", - always insert the toggle at the top of the overflow menu using `MenuItemFields::toggle_pane_action(is_maximized)` with the local file actions following after a separator. Add a regression test that opens a local Markdown file in the rendered view and asserts the overflow menu includes "Maximize pane". Co-authored-by: Cursor <cursoragent@cursor.com>
|
This PR is not linked to an issue that is marked with Issue-state enforcement details:
Readiness check:
To continue, link this PR to a same-repo issue such as Powered by Oz |
There was a problem hiding this comment.
This PR is not linked to an issue that is marked with ready-to-implement.
Issue-state enforcement details:
-
Associated same-repo issues checked: #11256
-
Required readiness label:
ready-to-implement
Readiness check:
- #11256: missing
ready-to-implement; readiness labels present: none
To continue, link this PR to a same-repo issue such as Closes #123 in the PR description, and make sure that issue has ready-to-implement.
Powered by Oz
|
I'm starting a first review of this pull request. You can view the conversation on Warp. I reviewed this pull request and requested human review from: Comment Powered by Oz |
Oz no longer requests changes for this pull request after the latest automated review.
There was a problem hiding this comment.
Overview
This PR adds the pane maximize/minimize overflow-menu action to FileNotebookView so Rendered Markdown panes match Raw Markdown behavior, and includes a regression test for the rendered Markdown overflow menu.
Concerns
- No blocking correctness, spec-alignment, or security concerns found in the changed lines.
- The PR description includes visual evidence for this user-facing menu change.
Verdict
Found: 0 critical, 0 important, 0 suggestions
Approve
Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz
Description
Fixes #11256. Close #11256.
In the Markdown pane, the overflow (three-dot) menu shows "Maximize pane" in Raw mode but is missing the same entry in Rendered mode. The two modes are backed by different views (
CodeViewfor Raw,FileNotebookViewfor Rendered) and onlyCodeViewwired the toggle into its overflow menu. This PR adds the same toggle toFileNotebookViewso the entry is present consistently regardless of mode.Root cause
app/src/code/view.rs::CodeView::overflow_menu_itemsalways insertsMenuItemFields::toggle_pane_action(is_maximized).app/src/notebooks/file/mod.rs::FileNotebookView::pane_header_overflow_menu_itemsnever added the corresponding entry.Fix
In
FileNotebookView:ToggleMaximizedvariant toFileNotebookActionand handle it by emittingPaneEvent::ToggleMaximizedand refreshing the overflow menu (so the label flips between "Maximize pane" / "Minimize pane" after the action runs, matchingCodeView).MenuItemFields::toggle_pane_action(is_maximized)at the top of the overflow menu, computingis_maximizedfrom the pane'sfocus_handleexactly the wayCodeViewdoes. Local-file actions follow after a separator.Linked Issue
Fixes #11256.
Testing
Automated
Added a regression test `notebooks::file::tests::test_rendered_markdown_overflow_menu_includes_maximize_pane` in `app/src/notebooks/file/mod_tests.rs` that opens a local Markdown file in `FileNotebookView` (the Rendered-mode view) and asserts that the labels returned by `pane_header_overflow_menu_items` include `"Maximize pane"`.
```
cargo nextest run -p warp notebooks::file::tests
Starting 7 tests across 1 binary (4460 tests skipped)
PASS [ 0.021s] (1/7) warp notebooks::file::tests::test_markdown_file_detection
PASS [ 0.031s] (2/7) warp notebooks::file::tests::test_load_static
PASS [ 0.062s] (3/7) warp notebooks::file::tests::test_file_notebook_mermaid_blocks_default_to_rendered
PASS [ 0.079s] (4/7) warp notebooks::file::tests::test_file_notebook_mermaid_context_menu_does_not_show_copy_image
PASS [ 0.079s] (5/7) warp notebooks::file::tests::test_load_before_session
PASS [ 0.079s] (6/7) warp notebooks::file::tests::test_load_local
PASS [ 0.079s] (7/7) warp notebooks::file::tests::test_rendered_markdown_overflow_menu_includes_maximize_pane
Summary [ 0.081s] 7 tests run: 7 passed, 4460 skipped
```
Also re-ran `notebooks::context_menu::tests` to confirm the existing right-click maximize/minimize wiring is untouched (3/3 pass).
Local presubmit-equivalent checks all green:
Manual
Steps to verify manually:
Screenshots / Videos
Agent Mode
Made with Cursor