Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 61 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
},
"dependencies": {
"react": "^19.2.0",
"react-dom": "^19.2.0"
"react-dom": "^19.2.0",
"react-router-dom": "^7.13.1"
},
"devDependencies": {
"@eslint/js": "^9.39.1",
Expand Down
26 changes: 25 additions & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,34 @@
import './App.css'
import { Link, Route, Routes } from 'react-router-dom'

function App() {
function HomeRoute() {

return (
<>
<h1>Hello, OrgExplorer!</h1>
</>
Comment on lines +9 to +10
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Externalize the routed page copy.

Hello, OrgExplorer!, 404, Page not found., and Go home are hardcoded in the component tree. Please move them into the project's resource files before expanding the route surface.

As per coding guidelines, "User-visible strings should be externalized to resource files (i18n)."

Also applies to: 19-21

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/App.tsx` around lines 9 - 10, The component currently hardcodes
user-visible strings (e.g., "Hello, OrgExplorer!", "404", "Page not found.", "Go
home") inside the App component and route JSX; extract these literals into the
i18n/resource system and replace the inline text with lookups (e.g., use
t('home.title') or a resources object) within App and any route components
(refer to App / the Route rendering that shows "404"/"Page not found."/"Go
home"). Ensure keys are added to the resource files and used via the existing
i18n/getString utility or a new simple wrapper so all visible strings in the
component tree are read from resources rather than hardcoded.

)
}



function NotFoundRoute() {
return (
<>
<h1>404</h1>
<p>Page not found.</p>
<Link to="/">Go home</Link>
</>
)
}
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated

return (
<>
<h1>Hello, OrgExplorer!</h1>
<Routes>
<Route path="/" element={<HomeRoute />} />
<Route path="*" element={<NotFoundRoute />} />
</Routes>
</>
)
}
Expand Down
5 changes: 4 additions & 1 deletion src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import { StrictMode } from 'react'
import { createRoot } from 'react-dom/client'
import { BrowserRouter } from 'react-router-dom'
import './index.css'
import App from './App.tsx'

createRoot(document.getElementById('root')!).render(
<StrictMode>
<App />
<BrowserRouter>
<App />
</BrowserRouter>
Comment on lines +9 to +11
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial

Verify SPA fallback support for BrowserRouter.

This setup only handles misses after the client boots. A direct request or hard refresh on /xyz will still return a server 404 unless the deployed host rewrites unknown paths to index.html. Please confirm that rewrite exists, or use HashRouter if the target hosting cannot provide it.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/main.tsx` around lines 9 - 11, The app currently uses BrowserRouter in
main.tsx (wrapping <App />) which requires the hosting to rewrite unknown paths
to index.html for direct navigations; verify the deployment configuration
provides that SPA fallback (rewrite/redirect unknown routes to index.html) and
confirm in the PR, or if the host cannot supply rewrites switch to HashRouter
(imported from react-router-dom and replace BrowserRouter with HashRouter around
<App />) so hard-refreshes/direct requests work without server rewrites.

</StrictMode>,
)
Loading