-
Notifications
You must be signed in to change notification settings - Fork 17
feat(launch): add capture-excluded notes window for recordings #43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
24ab7d0
e151d76
0322ce8
974f165
4d06e5e
5d03568
cf63d10
3dad308
d1ff93e
b280512
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,6 +1,7 @@ | ||||||||||||||||||||||
| import { lazy, Suspense, useEffect, useState } from "react"; | ||||||||||||||||||||||
| import { CountdownOverlay } from "./components/launch/CountdownOverlay.tsx"; | ||||||||||||||||||||||
| import { LaunchWindow } from "./components/launch/LaunchWindow"; | ||||||||||||||||||||||
| import { NotesWindow } from "./components/launch/NotesWindow.tsx"; | ||||||||||||||||||||||
| import { SourceSelector } from "./components/launch/SourceSelector"; | ||||||||||||||||||||||
| import { Toaster } from "./components/ui/sonner"; | ||||||||||||||||||||||
| import { TooltipProvider } from "./components/ui/tooltip"; | ||||||||||||||||||||||
|
|
@@ -19,6 +20,8 @@ export default function App() { | |||||||||||||||||||||
| const [windowType, setWindowType] = useState( | ||||||||||||||||||||||
| () => new URLSearchParams(window.location.search).get("windowType") || "", | ||||||||||||||||||||||
| ); | ||||||||||||||||||||||
| const showNotes = new URLSearchParams(window.location.search).get("showNotes") === "true"; | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
|
coderabbitai[bot] marked this conversation as resolved.
|
||||||||||||||||||||||
| const tEditor = useScopedT("editor"); | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| useEffect(() => { | ||||||||||||||||||||||
|
|
@@ -102,15 +105,18 @@ export default function App() { | |||||||||||||||||||||
| ); | ||||||||||||||||||||||
| default: | ||||||||||||||||||||||
| return ( | ||||||||||||||||||||||
| <div className="w-full h-full bg-background text-foreground"> | ||||||||||||||||||||||
| <h1>Openscreen</h1> | ||||||||||||||||||||||
| <div> | ||||||||||||||||||||||
| <div className="w-full h-full bg-background text-foreground"> | ||||||||||||||||||||||
| <h1>Openscreen</h1> | ||||||||||||||||||||||
| </div> | ||||||||||||||||||||||
| </div> | ||||||||||||||||||||||
| ); | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
| })(); | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| return ( | ||||||||||||||||||||||
| <TooltipProvider> | ||||||||||||||||||||||
| {showNotes && <NotesWindow />} | ||||||||||||||||||||||
| {content} | ||||||||||||||||||||||
|
Comment on lines
117
to
120
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win Make the notes render path exclusive. Per the new route contract, the notes window is opened with Suggested fix return (
<TooltipProvider>
- {showNotes && <NotesWindow />}
- {content}
+ {showNotes ? <NotesWindow /> : content}
<Toaster theme="dark" />
</TooltipProvider>
);📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This will not work cause we will need noteswindow to show up when content is also open There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
My concern was only about what renders inside the window opened with In other words:
Right now, in the notes window, So the exclusivity is per-renderer-window, not app-wide. If you do intend to support a case where the same window can have both (ᵔᴥᵔ) |
||||||||||||||||||||||
| <Toaster theme="dark" /> | ||||||||||||||||||||||
| </TooltipProvider> | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| import React, { useLayoutEffect, useState } from "react"; | ||
| import { useScopedT } from "@/contexts/I18nContext"; | ||
|
|
||
| export function NotesWindow() { | ||
| const t = useScopedT("launch"); | ||
| const [notes, setNotes] = useState(""); | ||
|
|
||
| const handleNotesChange = (e: React.ChangeEvent<HTMLTextAreaElement>) => { | ||
| localStorage.setItem("notes", e.target.value); | ||
| setNotes(e.target.value); | ||
| }; | ||
|
|
||
| useLayoutEffect(() => { | ||
| setNotes(localStorage.getItem("notes") ?? ""); | ||
| }, []); | ||
|
|
||
| return ( | ||
| <div className="bg-white h-screen w-screen px-6 py-4"> | ||
| <textarea | ||
| className="w-full h-full bg-transparent outline-none resize-none caret-black text-black" | ||
| placeholder={t("tooltips.openNotesPlaceholder")} | ||
| value={notes} | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| onChange={handleNotesChange} | ||
| /> | ||
| </div> | ||
| ); | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.