mirror of
https://github.com/atuinsh/atuin.git
synced 2024-11-25 01:34:13 +01:00
fix(gui): terminal resize overflow (#2285)
This commit is contained in:
parent
93db7578e9
commit
97d978c267
@ -130,8 +130,11 @@ function App() {
|
|||||||
];
|
];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex h-dvh w-full select-none">
|
<div
|
||||||
<div className="relative flex h-full flex-col !border-r-small border-divider transition-width pb-6 pt-9 min-w-[4.5rem] items-center">
|
className="flex h-dvh w-screen select-none"
|
||||||
|
style={{ maxWidth: "100vw" }}
|
||||||
|
>
|
||||||
|
<div className="relative flex h-full flex-col !border-r-small border-divider transition-width pb-6 pt-9 items-center">
|
||||||
<div className="flex items-center gap-0 px-3 justify-center">
|
<div className="flex items-center gap-0 px-3 justify-center">
|
||||||
<div className="flex h-8 w-8">
|
<div className="flex h-8 w-8">
|
||||||
<img src={icon} alt="icon" className="h-8 w-8" />
|
<img src={icon} alt="icon" className="h-8 w-8" />
|
||||||
|
@ -124,7 +124,7 @@ export default function Editor() {
|
|||||||
|
|
||||||
// Renders the editor instance.
|
// Renders the editor instance.
|
||||||
return (
|
return (
|
||||||
<div className="p-4 w-full">
|
<div className="overflow-y-scroll w-full">
|
||||||
<BlockNoteView
|
<BlockNoteView
|
||||||
editor={editor}
|
editor={editor}
|
||||||
slashMenu={false}
|
slashMenu={false}
|
||||||
|
@ -65,8 +65,9 @@ const RunBlock = ({
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="w-full !outline-none">
|
<div className="w-full !max-w-full !outline-none overflow-none">
|
||||||
<div className="flex items-start">
|
<div className="flex flex-row items-start">
|
||||||
|
<div className="flex">
|
||||||
<button
|
<button
|
||||||
onClick={handleToggle}
|
onClick={handleToggle}
|
||||||
className={`flex items-center justify-center flex-shrink-0 w-8 h-8 mr-2 rounded border focus:outline-none focus:ring-2 transition-all duration-300 ease-in-out ${
|
className={`flex items-center justify-center flex-shrink-0 w-8 h-8 mr-2 rounded border focus:outline-none focus:ring-2 transition-all duration-300 ease-in-out ${
|
||||||
@ -82,14 +83,14 @@ const RunBlock = ({
|
|||||||
{isRunning ? <Square size={16} /> : <Play size={16} />}
|
{isRunning ? <Square size={16} /> : <Play size={16} />}
|
||||||
</span>
|
</span>
|
||||||
</button>
|
</button>
|
||||||
<div className="flex-grow">
|
</div>
|
||||||
|
<div className="flex-1 min-w-0 w-40">
|
||||||
<CodeMirror
|
<CodeMirror
|
||||||
id={id}
|
id={id}
|
||||||
placeholder={"Write your code here..."}
|
placeholder={"Write your code here..."}
|
||||||
className="!pt-0 border border-gray-300 rounded"
|
className="!pt-0 max-w-full border border-gray-300 rounded"
|
||||||
value={code}
|
value={code}
|
||||||
editable={isEditable}
|
editable={isEditable}
|
||||||
width="100%"
|
|
||||||
autoFocus
|
autoFocus
|
||||||
onChange={(val) => {
|
onChange={(val) => {
|
||||||
setValue(val);
|
setValue(val);
|
||||||
@ -99,7 +100,7 @@ const RunBlock = ({
|
|||||||
basicSetup={false}
|
basicSetup={false}
|
||||||
/>
|
/>
|
||||||
<div
|
<div
|
||||||
className={`overflow-hidden transition-all duration-300 ease-in-out ${
|
className={`overflow-hidden transition-all duration-300 ease-in-out min-w-0 ${
|
||||||
showTerminal ? "block" : "hidden"
|
showTerminal ? "block" : "hidden"
|
||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
|
@ -55,6 +55,7 @@ const TerminalComponent = ({ pty }: any) => {
|
|||||||
terminal.loadAddon(fitAddon);
|
terminal.loadAddon(fitAddon);
|
||||||
terminal.onResize(onResize(pty));
|
terminal.onResize(onResize(pty));
|
||||||
|
|
||||||
|
fitAddon.fit();
|
||||||
const windowResize = () => {
|
const windowResize = () => {
|
||||||
fitAddon.fit();
|
fitAddon.fit();
|
||||||
};
|
};
|
||||||
@ -67,8 +68,6 @@ const TerminalComponent = ({ pty }: any) => {
|
|||||||
|
|
||||||
window.addEventListener("resize", windowResize);
|
window.addEventListener("resize", windowResize);
|
||||||
|
|
||||||
fitAddon.fit();
|
|
||||||
|
|
||||||
// Customize further as needed
|
// Customize further as needed
|
||||||
return () => {
|
return () => {
|
||||||
terminal.dispose();
|
terminal.dispose();
|
||||||
@ -76,7 +75,9 @@ const TerminalComponent = ({ pty }: any) => {
|
|||||||
};
|
};
|
||||||
}, [pty]);
|
}, [pty]);
|
||||||
|
|
||||||
return <div ref={terminalRef} />;
|
return (
|
||||||
|
<div className="!max-w-full min-w-0 overflow-hidden" ref={terminalRef} />
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default TerminalComponent;
|
export default TerminalComponent;
|
||||||
|
@ -8,7 +8,7 @@ ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render(
|
|||||||
<React.StrictMode>
|
<React.StrictMode>
|
||||||
<NextUIProvider>
|
<NextUIProvider>
|
||||||
<main className="text-foreground bg-background">
|
<main className="text-foreground bg-background">
|
||||||
<div data-tauri-drag-region className="w-full h-8 absolute" />
|
<div data-tauri-drag-region className="w-full min-h-8 absolute z-10" />
|
||||||
<App />
|
<App />
|
||||||
</main>
|
</main>
|
||||||
</NextUIProvider>
|
</NextUIProvider>
|
||||||
|
@ -36,7 +36,7 @@ function Header({ name }: any) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="md:flex md:items-center md:justify-between">
|
<div className="md:flex md:items-center md:justify-between">
|
||||||
<div className="min-w-0 flex-1">
|
<div className="flex-1">
|
||||||
<h2 className="text-2xl font-bold leading-7 text-gray-900 sm:truncate sm:text-3xl sm:tracking-tight">
|
<h2 className="text-2xl font-bold leading-7 text-gray-900 sm:truncate sm:text-3xl sm:tracking-tight">
|
||||||
{greeting}
|
{greeting}
|
||||||
</h2>
|
</h2>
|
||||||
|
@ -6,7 +6,7 @@ export default function Runbooks() {
|
|||||||
const currentRunbook = useStore((store) => store.currentRunbook);
|
const currentRunbook = useStore((store) => store.currentRunbook);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="w-full flex flex-row ">
|
<div className="flex w-full !max-w-full flex-row ">
|
||||||
<List />
|
<List />
|
||||||
{currentRunbook && <Editor />}
|
{currentRunbook && <Editor />}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user