-
Notifications
You must be signed in to change notification settings - Fork 2
PR to add a walkthrough to guide new user to pathfinder and all of its features. #22
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
Changes from all commits
acdb553
92f110f
8897e5f
494d9cd
52bb1d1
bd17f13
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| import { useEffect, useState } from "react"; | ||
|
|
||
| export function useFirstLaunch() { | ||
| const [isFirstLaunch, setIsFirstLaunch] = useState(null); | ||
|
|
||
| useEffect(() => { | ||
| const flag = localStorage.getItem("firstLaunch"); | ||
|
|
||
| if (flag === null) { | ||
| localStorage.setItem("firstLaunch", "true"); | ||
| setIsFirstLaunch(true); | ||
| } else { | ||
| setIsFirstLaunch(false); | ||
| } | ||
| }, []); | ||
|
|
||
| return isFirstLaunch; | ||
| } | ||
|
Comment on lines
+3
to
+18
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. Fix the initial null state to prevent incorrect rendering. The initial Solution: Initialize with a loading state and render nothing until the value is determined: export function useFirstLaunch() {
- const [isFirstLaunch, setIsFirstLaunch] = useState(null);
+ const [isFirstLaunch, setIsFirstLaunch] = useState(undefined);
useEffect(() => {
const flag = localStorage.getItem("firstLaunch");
if (flag === null) {
localStorage.setItem("firstLaunch", "true");
setIsFirstLaunch(true);
} else {
setIsFirstLaunch(false);
}
}, []);
return isFirstLaunch;
}Then in const isFirstLaunch = useFirstLaunch();
if (isFirstLaunch === undefined) {
return null; // or a loading spinner
}
return (
<BrowserRouter>
{/* routes */}
</BrowserRouter>
);🤖 Prompt for AI Agents |
||
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,24 @@ | ||||||||||||
| import { Link } from "react-router-dom" | ||||||||||||
|
|
||||||||||||
|
|
||||||||||||
| function About(){ | ||||||||||||
| console.log(localStorage.getItem("name")) | ||||||||||||
| const username_json = localStorage.getItem("name") | ||||||||||||
| const username = JSON.parse(username_json); | ||||||||||||
|
Comment on lines
+5
to
+7
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. Add error handling for localStorage access and remove console.log. Two issues:
Apply this diff to add error handling with a default value: - console.log(localStorage.getItem("name"))
- const username_json = localStorage.getItem("name")
- const username = JSON.parse(username_json);
+ const username_json = localStorage.getItem("name")
+ const username = username_json ? JSON.parse(username_json) : { name: "Guest" };📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||
| return( | ||||||||||||
| <div style={{ | ||||||||||||
| backgroundImage: "radial-gradient(circle, rgba(39, 39, 42, 1) 1.5px, transparent 1px)", | ||||||||||||
| backgroundSize: "20px 20px", | ||||||||||||
| backgroundRepeat: "repeat", | ||||||||||||
| }} | ||||||||||||
| className="flex flex-col justify-center gap-5 p-5 h-[100vh] bg-[#3D3C3C] font-sans text-white"> | ||||||||||||
| <div className="felx flex-row justify-left text-left text-4xl ">Hi {username.name}, Welcome to Pathfinder</div> | ||||||||||||
|
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. Fix typo in className. The className contains "felx" which should be "flex". Apply this diff: - <div className="felx flex-row justify-left text-left text-4xl ">Hi {username.name}, Welcome to Pathfinder</div>
+ <div className="flex flex-row justify-left text-left text-4xl ">Hi {username.name}, Welcome to Pathfinder</div>📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||
| <div className="text-left backdrop-blur-sm"> | ||||||||||||
| A powerful Raycast-inspired launcher application built with Tauri and React. PathFinder provides instant access to your most-used tools and information through a beautiful, keyboard-driven interface. And you can access it just my pressing | ||||||||||||
|
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. Fix grammatical error in user-facing text. The text contains "just my pressing" which should be "just by pressing". Apply this diff: - A powerful Raycast-inspired launcher application built with Tauri and React. PathFinder provides instant access to your most-used tools and information through a beautiful, keyboard-driven interface. And you can access it just my pressing
+ A powerful Raycast-inspired launcher application built with Tauri and React. PathFinder provides instant access to your most-used tools and information through a beautiful, keyboard-driven interface. And you can access it just by pressing 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||
| </div> | ||||||||||||
| <div className="text-5xl text-center text-[#737373]">Ctrl+Shift+Space</div> | ||||||||||||
| <Link to='/ClipboardGuide'><button className="absolute bottom-3 left-180 flex flex-row justify-center py-1 px-3 bg-black rounded-md text-center text-white ">next</button></Link> | ||||||||||||
|
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. Add explicit type attribute to button element. The button is missing an explicit As per static analysis hints. Apply this diff: - <Link to='/ClipboardGuide'><button className="absolute bottom-3 left-180 flex flex-row justify-center py-1 px-3 bg-black rounded-md text-center text-white ">next</button></Link>
+ <Link to='/ClipboardGuide'><button type="button" className="absolute bottom-3 left-180 flex flex-row justify-center py-1 px-3 bg-black rounded-md text-center text-white ">next</button></Link>📝 Committable suggestion
Suggested change
🧰 Tools🪛 Biome (2.1.2)[error] 20-20: Provide an explicit type prop for the button element. The default type of a button is submit, which causes the submission of a form when placed inside a (lint/a11y/useButtonType) 🤖 Prompt for AI Agents |
||||||||||||
| </div> | ||||||||||||
| ) | ||||||||||||
| } | ||||||||||||
| export default About | ||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,30 @@ | ||||||||||
| import { Link } from "react-router-dom" | ||||||||||
| import snapshort1 from '../assets/snapshot1.png' | ||||||||||
| import snapshot2 from '../assets/snapshort2.png' | ||||||||||
|
Comment on lines
+2
to
+3
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. Inconsistent asset filename spelling. Line 2 imports -import snapshort1 from '../assets/snapshot1.png'
-import snapshot2 from '../assets/snapshort2.png'
+import snapshot1 from '../assets/snapshot1.png'
+import snapshot2 from '../assets/snapshot2.png'Then update usage on lines 14 and 21: - <img src={snapshort1} alt='snapshot1'
+ <img src={snapshot1} alt='snapshot1'📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||
|
|
||||||||||
|
|
||||||||||
| function ClipboardGuide(){ | ||||||||||
| return( | ||||||||||
| <div className="flex flex-col justify-center gap-5 p-5 h-full bg-[#3D3C3C] font-sans text-white"> | ||||||||||
| <div className="flex flex-row justify-left text-left text-4xl ">Clipboard:</div> | ||||||||||
|
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. Fix invalid Tailwind class The class - <div className="flex flex-row justify-left text-left text-4xl ">Clipboard:</div>
+ <div className="flex flex-row justify-start text-left text-4xl ">Clipboard:</div>📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||
| <div className="text-left backdrop-blur-sm"> | ||||||||||
| A clipboard manager feature that displays all copied items with details like timestamp, size, and usage count. Users can easily view, search, and re-copy any saved entry, making it simple to manage frequently used texts or data efficiently. | ||||||||||
| </div> | ||||||||||
| <div className="m-5 px-10 pt-10 rounded-t-xl bg-[#929292]"> | ||||||||||
| <img src={snapshort1} alt='snapshot1' | ||||||||||
| className="rounded-t-xl "/> | ||||||||||
| </div> | ||||||||||
|
|
||||||||||
| <div className="text-left mt-5 backdrop-blur-sm"> | ||||||||||
| A clipboard search feature that lets users quickly find any saved clipboard entry by typing keywords. It filters items in real-time, showing relevant results with details like timestamp, size, and usage, enabling fast retrieval and efficient clipboard management. </div> | ||||||||||
| <div className="m-5 px-10 pt-10 rounded-t-xl bg-[#929292]"> | ||||||||||
| <img src={snapshot2} alt='snapshot2' | ||||||||||
| className="rounded-t-xl "/> | ||||||||||
| </div> | ||||||||||
|
|
||||||||||
| <Link to='/OnlineSearchGuide'><button className="relative bottom-3 left-170 flex flex-row justify-center py-1 px-3 bg-black rounded-md text-center text-white ">next</button></Link> | ||||||||||
|
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. Fix invalid Tailwind class and add button type. Two issues on this line:
As per static analysis hints. - <Link to='/OnlineSearchGuide'><button className="relative bottom-3 left-170 flex flex-row justify-center py-1 px-3 bg-black rounded-md text-center text-white ">next</button></Link>
+ <Link to='/OnlineSearchGuide'><button type="button" className="relative bottom-3 left-[170px] flex flex-row justify-center py-1 px-3 bg-black rounded-md text-center text-white ">next</button></Link>📝 Committable suggestion
Suggested change
🧰 Tools🪛 Biome (2.1.2)[error] 25-25: Provide an explicit type prop for the button element. The default type of a button is submit, which causes the submission of a form when placed inside a (lint/a11y/useButtonType) 🤖 Prompt for AI Agents |
||||||||||
|
|
||||||||||
| </div> | ||||||||||
| ) | ||||||||||
| } | ||||||||||
| export default ClipboardGuide | ||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| import { Link } from "react-router-dom" | ||
|
|
||
|
|
||
| function GuideEnd(){ | ||
|
|
||
| return( | ||
| <div className="flex flex-row gap-3 justify-center items-center h-[100vh] w-[100vw] bg-[#3D3C3C]"> | ||
| <div className="text-center text-5xl"> | ||
| All done, continue to | ||
| </div> | ||
| <Link to='/'><button type="button" className="py-2 px-3 bg-black rounded-md text-center text-white text-5xl">Pathfinder</button></Link> | ||
| </div> | ||
| ) | ||
| } | ||
| export default GuideEnd |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| import { useEffect, useState, useRef } from "react"; | ||
| import { getCurrentWindow } from "@tauri-apps/api/window"; | ||
| import "../App.css"; | ||
| import HomeOptions from "../components/HomeOptions"; | ||
| import ClipboardPage from "../components/ClipboardPage"; | ||
| import OnlineSearchPage from "../components/OnlineSearchPage"; | ||
| import OpenFilePage from "../components/OpenFilePage"; | ||
|
|
||
| function Home() { | ||
|
|
||
| const [query, setQuery] = useState(""); | ||
| const inputRef = useRef(null); | ||
| const [currentPage, setCurrentPage] = useState("home"); | ||
|
|
||
| useEffect(() => { | ||
| function handleKeyDown(e) { | ||
| if (e.key === "Escape") { | ||
| if (currentPage === "home") { | ||
| getCurrentWindow().hide(); | ||
| } else { | ||
| setCurrentPage("home"); | ||
| setQuery(""); | ||
| inputRef.current?.focus(); | ||
| } | ||
| } | ||
| } | ||
|
|
||
| window.addEventListener("keydown", handleKeyDown); | ||
| return () => window.removeEventListener("keydown", handleKeyDown); | ||
| }, [currentPage]); | ||
|
|
||
| useEffect(() => { | ||
| inputRef.current?.focus(); | ||
| }, []); | ||
|
|
||
| return ( | ||
|
|
||
| <div className="raycast-overlay"> | ||
| <div className="input-wrapper"> | ||
| <input | ||
| ref={inputRef} | ||
| placeholder="Search..." | ||
| value={query} | ||
| onChange={(e) => setQuery(e.target.value)} | ||
| className="search-input" | ||
| /> | ||
| </div> | ||
| <div className="main-container"> | ||
| <div className="results"> | ||
| {currentPage === "home" && ( | ||
| <HomeOptions | ||
| query={query} | ||
| onSelect={setCurrentPage} | ||
| clearQuery={() => { | ||
| setQuery(""); | ||
| inputRef.current?.focus(); | ||
| }} | ||
| /> | ||
| )} | ||
| {currentPage === "clipboard" && <ClipboardPage query={query} />} | ||
| {currentPage === "online-search" && ( | ||
| <OnlineSearchPage query={query} /> | ||
| )} | ||
| {currentPage === "open-file" && <OpenFilePage query={query} />} | ||
| </div> | ||
| </div> | ||
| </div> | ||
| ); | ||
| } | ||
|
|
||
| export default Home; |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,38 @@ | ||||||
| import { Link } from "react-router-dom" | ||||||
| import { useForm } from "react-hook-form" | ||||||
| import { useNavigate } from "react-router-dom"; | ||||||
|
|
||||||
|
|
||||||
| function Name(){ | ||||||
|
|
||||||
| const navigate = useNavigate(); | ||||||
|
|
||||||
| const { | ||||||
| register, | ||||||
| handleSubmit, | ||||||
| formState: { errors }, | ||||||
|
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. 🧹 Nitpick | 🔵 Trivial Unused form validation errors. The 🤖 Prompt for AI Agents |
||||||
| } = useForm() | ||||||
|
|
||||||
| const onSubmit = (data) => { | ||||||
| localStorage.setItem("name", JSON.stringify(data)) | ||||||
| // console.log(localStorage.getItem("name")) | ||||||
| navigate("/About"); | ||||||
| } | ||||||
|
|
||||||
| return( | ||||||
| <div className="flex flex-col justify-center items-center gap-5 h-[100vh] bg-[#3D3C3C] font-sans"> | ||||||
| <div className="text-4xl">Enter Your Name</div> | ||||||
| <div> | ||||||
| <form onSubmit={handleSubmit(onSubmit)}> | ||||||
| <input | ||||||
| className="bg-white rounded-md text-2xl text-center" | ||||||
| defaultValue="" {...register("name")} type='text' placeholder="Type"/> | ||||||
|
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. 🛠️ Refactor suggestion | 🟠 Major Add validation for required name input. The name input has no validation, allowing users to submit an empty name. This would result in "Hi , Welcome to Pathfinder" on the About page. Apply this diff to add required validation: - defaultValue="" {...register("name")} type='text' placeholder="Type"/>
+ defaultValue="" {...register("name", { required: true })} type='text' placeholder="Type"/>Consider also displaying an error message when the field is empty: + {errors.name && <span className="text-red-500">Name is required</span>}📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| </form> | ||||||
| </div> | ||||||
| <Link to='/About'><button type='submit' className="absolute bottom-3 right-5 flex flex-row justify-center py-1 px-3 bg-black rounded-md text-center text-white ">next</button></Link> | ||||||
|
|
||||||
|
Comment on lines
+22
to
+33
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. Critical: Form submission is broken. The submit button (line 32) is outside the
Apply this diff to fix the form structure: - <div>
- <form onSubmit={handleSubmit(onSubmit)}>
- <input
- className="bg-white rounded-md text-2xl text-center"
- defaultValue="" {...register("name")} type='text' placeholder="Type"/>
- </form>
- </div>
- <Link to='/About'><button type='submit' className="absolute bottom-3 right-5 flex flex-row justify-center py-1 px-3 bg-black rounded-md text-center text-white ">next</button></Link>
+ <form onSubmit={handleSubmit(onSubmit)} className="flex flex-col items-center gap-5">
+ <input
+ className="bg-white rounded-md text-2xl text-center"
+ defaultValue="" {...register("name")} type='text' placeholder="Type"/>
+ <button type='submit' className="absolute bottom-3 right-5 flex flex-row justify-center py-1 px-3 bg-black rounded-md text-center text-white ">next</button>
+ </form>🤖 Prompt for AI Agents |
||||||
| </div> | ||||||
| ) | ||||||
| } | ||||||
|
|
||||||
| export default Name | ||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,20 @@ | ||||||
| import { Link } from "react-router-dom" | ||||||
| import snapshot3 from '../assets/snapshort3.png' | ||||||
|
|
||||||
|
|
||||||
| function OnlineSearchGuide(){ | ||||||
| return( | ||||||
| <div className="flex flex-col justify-center gap-5 p-5 h-full bg-[#3D3C3C] font-sans text-white"> | ||||||
| <div className="flex flex-row justify-left text-left text-4xl ">Online Search:</div> | ||||||
|
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. Fix invalid Tailwind class The class - <div className="flex flex-row justify-left text-left text-4xl ">Online Search:</div>
+ <div className="flex flex-row justify-start text-left text-4xl ">Online Search:</div>📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| <div className="text-left backdrop-blur-sm"> | ||||||
| Quick-access web search allows users to instantly search the internet directly from the app. With a streamlined interface, it supports rapid queries, displays results efficiently, and saves frequently used searches, enabling fast, convenient, and productive online information retrieval. </div> | ||||||
| <div className="m-5 px-10 pt-10 rounded-t-xl bg-[#929292]"> | ||||||
| <img src={snapshot3} alt='snapshot1' | ||||||
| className="flex justify-center items-center rounded-t-xl "/> | ||||||
| </div> | ||||||
| <Link to='/OpenFileGuide'><button type="button" className="relative bottom-3 left-170 flex flex-row justify-center py-1 px-3 bg-black rounded-md text-center text-white ">next</button></Link> | ||||||
|
|
||||||
| </div> | ||||||
| ) | ||||||
| } | ||||||
| export default OnlineSearchGuide | ||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,19 @@ | ||||||
| import { Link } from "react-router-dom" | ||||||
| import snapshort4 from '../assets/snapshort4.png' | ||||||
|
|
||||||
|
|
||||||
|
|
||||||
| function OpenFileGuide(){ | ||||||
| return( | ||||||
| <div className="flex flex-col justify-center gap-5 p-5 h-full bg-[#3D3C3C] font-sans text-white"> | ||||||
| <div className="flex flex-row justify-left text-left text-4xl ">Open File:</div> | ||||||
|
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. Fix invalid Tailwind class The class - <div className="flex flex-row justify-left text-left text-4xl ">Open File:</div>
+ <div className="flex flex-row justify-start text-left text-4xl ">Open File:</div>📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| <div className="text-left backdrop-blur-sm"> | ||||||
| A fast file access feature that lets users locate and open files instantly. By typing filenames or keywords, it quickly filters results, showing file paths and details, streamlining workflow and saving time when managing documents, media, or system files. </div> | ||||||
| <div className="m-5 px-10 pt-10 rounded-t-xl bg-[#929292]"> | ||||||
| <img src={snapshort4} alt='snapshot1' className="rounded-t-xl "/> | ||||||
| </div> | ||||||
| <Link to='/GuideEnd'><button type='button' className="relative bottom-3 left-170 flex flex-row justify-center py-1 px-3 bg-black rounded-md text-center text-white ">next</button></Link> | ||||||
|
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. Fix invalid Tailwind class The class - <Link to='/GuideEnd'><button type='button' className="relative bottom-3 left-170 flex flex-row justify-center py-1 px-3 bg-black rounded-md text-center text-white ">next</button></Link>
+ <Link to='/GuideEnd'><button type='button' className="relative bottom-3 left-[170px] flex flex-row justify-center py-1 px-3 bg-black rounded-md text-center text-white ">next</button></Link>📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| </div> | ||||||
| ) | ||||||
| } | ||||||
| export default OpenFileGuide | ||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| import { Link } from "react-router-dom" | ||
|
|
||
|
|
||
| function Welcome(){ | ||
| return( | ||
| <div style={{ | ||
| backgroundImage: "radial-gradient(circle, rgba(39, 39, 42, 1) 1.5px, transparent 1px)", | ||
| backgroundSize: "20px 20px", | ||
| backgroundRepeat: "repeat", | ||
| }} | ||
| className="flex flex-col justify-center items-center gap-1 h-[100vh] bg-[#3D3C3C] font-sans"> | ||
| <div className="flex flex-row justify-center text-6xl pb-5 font-bold">Pathfinder</div> | ||
| <div className="felx flex-row justify-center text-center text-3xl">A tool to make your life easy</div> | ||
|
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. Fix typo in className. The className contains "felx" which should be "flex". Apply this diff: - <div className="felx flex-row justify-center text-center text-3xl">A tool to make your life easy</div>
+ <div className="flex flex-row justify-center text-center text-3xl">A tool to make your life easy</div>🤖 Prompt for AI Agents |
||
| <Link to='/name'><button type="button" className="absolute bottom-3 right-5 flex flex-row justify-center py-1 px-3 bg-black rounded-md text-center text-white ">next</button></Link> | ||
| </div> | ||
| ) | ||
| } | ||
| export default Welcome | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion | 🟠 Major
Remove unused imports.
The imports
useEffect,useState,useRef(line 1) andgetCurrentWindow(line 2) are not used in this refactored version of App.jsx.🤖 Prompt for AI Agents