fix: mobile terminal back and X buttons navigate to /sessions
Terminal sessions are opened in a new tab via window.open with
noopener,noreferrer. In a new tab, window.history has no previous
entry, so navigate(-1) silently does nothing. Both the back arrow
and the X button in the mobile terminal overlay called navigate(-1),
which made them appear broken.
Change both buttons to navigate('/sessions') so they always exit
to a sensible page regardless of how the terminal was opened.
Quality gates: tsc --noEmit (pass), build (pass)
This commit is contained in:
@@ -318,7 +318,7 @@ export const TerminalPage: React.FC = () => {
|
||||
<div className="mobile-terminal-toolbar-left">
|
||||
<button
|
||||
className="mobile-terminal-toolbtn"
|
||||
onClick={() => navigate(-1)}
|
||||
onClick={() => navigate("/sessions")}
|
||||
type="button"
|
||||
aria-label="Back"
|
||||
>
|
||||
@@ -353,7 +353,7 @@ export const TerminalPage: React.FC = () => {
|
||||
</button>
|
||||
<button
|
||||
className="mobile-terminal-toolbtn"
|
||||
onClick={() => navigate(-1)}
|
||||
onClick={() => navigate("/sessions")}
|
||||
type="button"
|
||||
aria-label="Exit terminal"
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user