diff --git a/emain/emain.ts b/emain/emain.ts index 9da5ef51c..ea647acd8 100644 --- a/emain/emain.ts +++ b/emain/emain.ts @@ -147,7 +147,7 @@ async function mainResizeHandler(_: any, windowId: string, win: Electron.Browser } function shNavHandler(event: Electron.Event, url: string) { - if (url.startsWith("http://127.0.0.1:5173/index.html")) { + if (url.startsWith("http://127.0.0.1:5173/index.html") || url.startsWith("http://localhost:5173/index.html")) { // this is a dev-mode hot-reload, ignore it console.log("allowing hot-reload of index.html"); return; diff --git a/frontend/app/block/block.tsx b/frontend/app/block/block.tsx index 68756488e..d209f9427 100644 --- a/frontend/app/block/block.tsx +++ b/frontend/app/block/block.tsx @@ -4,7 +4,7 @@ import { CodeEdit } from "@/app/view/codeedit"; import { PlotView } from "@/app/view/plotview"; import { PreviewView } from "@/app/view/preview"; -import { TerminalView } from "@/app/view/term"; +import { TerminalView } from "@/app/view/term/term"; import { ErrorBoundary } from "@/element/errorboundary"; import { CenteredDiv } from "@/element/quickelems"; import * as WOS from "@/store/wos"; diff --git a/frontend/app/view/ijson.tsx b/frontend/app/view/term/ijson.tsx similarity index 100% rename from frontend/app/view/ijson.tsx rename to frontend/app/view/term/ijson.tsx diff --git a/frontend/app/view/term/term.less b/frontend/app/view/term/term.less new file mode 100644 index 000000000..f0b8d533b --- /dev/null +++ b/frontend/app/view/term/term.less @@ -0,0 +1,87 @@ +// Copyright 2024, Command Line Inc. +// SPDX-License-Identifier: Apache-2.0 + +.view-term { + display: flex; + flex-direction: column; + width: 100%; + height: 100%; + overflow: hidden; + border-left: 4px solid transparent; + padding-left: 4px; + + &:focus-within { + border-left: 4px solid var(--accent-color); + } + + .term-header { + display: flex; + flex-direction: row; + padding: 4px 10px; + height: 35px; + gap: 10px; + align-items: center; + flex-shrink: 0; + border-bottom: 1px solid var(--border-color); + } + + .term-connectelem { + flex-grow: 1; + min-height: 0; + overflow: hidden; + line-height: 1; + } + + .term-htmlelem { + display: flex; + flex-direction: column; + width: 100%; + flex-grow: 1; + min-height: 0; + overflow: hidden; + + .term-htmlelem-focus { + height: 0; + width: 0; + input { + width: 0; + height: 0; + opacity: 0; + pointer-events: none; + } + } + + .term-htmlelem-content { + display: flex; + flex-direction: row; + width: 100%; + flex-grow: 1; + min-height: 0; + overflow: hidden; + } + } + + &.term-mode-term { + .term-connectelem { + display: flex; + } + .term-htmlelem { + display: none; + } + } + + &.term-mode-html { + .term-connectelem { + display: none; + } + .term-htmlelem { + display: flex; + } + + .ijson iframe { + width: 100%; + height: 100%; + border: none; + } + } +} diff --git a/frontend/app/view/term.tsx b/frontend/app/view/term/term.tsx similarity index 99% rename from frontend/app/view/term.tsx rename to frontend/app/view/term/term.tsx index f4e89dded..9d6f4d73b 100644 --- a/frontend/app/view/term.tsx +++ b/frontend/app/view/term/term.tsx @@ -23,7 +23,7 @@ import { IJsonView } from "./ijson"; import "public/xterm.css"; import { debounce } from "throttle-debounce"; -import "./view.less"; +import "./term.less"; function getThemeFromCSSVars(el: Element): ITheme { const theme: ITheme = {}; diff --git a/frontend/app/view/view.less b/frontend/app/view/view.less index e0536a979..1fd17c5c1 100644 --- a/frontend/app/view/view.less +++ b/frontend/app/view/view.less @@ -1,91 +1,6 @@ // Copyright 2024, Command Line Inc. // SPDX-License-Identifier: Apache-2.0 -.view-term { - display: flex; - flex-direction: column; - width: 100%; - height: 100%; - overflow: hidden; - border-left: 4px solid transparent; - padding-left: 4px; - - &:focus-within { - border-left: 4px solid var(--accent-color); - } - - .term-header { - display: flex; - flex-direction: row; - padding: 4px 10px; - height: 35px; - gap: 10px; - align-items: center; - flex-shrink: 0; - border-bottom: 1px solid var(--border-color); - } - - .term-connectelem { - flex-grow: 1; - min-height: 0; - overflow: hidden; - line-height: 1; - } - - .term-htmlelem { - display: flex; - flex-direction: column; - width: 100%; - flex-grow: 1; - min-height: 0; - overflow: hidden; - - .term-htmlelem-focus { - height: 0; - width: 0; - input { - width: 0; - height: 0; - opacity: 0; - pointer-events: none; - } - } - - .term-htmlelem-content { - display: flex; - flex-direction: row; - width: 100%; - flex-grow: 1; - min-height: 0; - overflow: hidden; - } - } - - &.term-mode-term { - .term-connectelem { - display: flex; - } - .term-htmlelem { - display: none; - } - } - - &.term-mode-html { - .term-connectelem { - display: none; - } - .term-htmlelem { - display: flex; - } - - .ijson iframe { - width: 100%; - height: 100%; - border: none; - } - } -} - .view-codeedit { display: flex; flex-direction: column;