Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions web/.env.production
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VITE_APP_CHAT_REBOOT_ENDPOINT=https://a442idxkzz7.prod1.rbt.cloud:9991
4 changes: 4 additions & 0 deletions web/.firebase/hosting.ZGlzdA.cache
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
vite.svg,1755049636484,9de4d3c4e50257d9874f07e9efc929efefc85e51f931a9af716f9a7ebb23ef68
index.html,1755049636969,3ce04dd71a68b39accfb18c6e82e3c56717f7cddbad5398694233579c6c75849
assets/index-Bkjp3jnN.css,1755049636968,88f3bc76faf694807abe7b1b424a6dcd7261f7376c6cebc2c34515cac4f34461
assets/index-CLioFiBL.js,1755049636969,07a71d7a25cc42ba4207edf6b50b24964b20985a92da6a89cac39ff37077e003
5 changes: 5 additions & 0 deletions web/.firebaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"projects": {
"default": "chat-reboot-dev-web"
}
}
16 changes: 16 additions & 0 deletions web/firebase.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"hosting": {
"public": "dist",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
}
}
5 changes: 2 additions & 3 deletions web/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,7 @@ const PendingChatbotMessage: FC<{ chatbotId: string; index: number }> = ({
));
};

const PendingChatbotMessages: FC<{ username: string }> = ({
username,
}) => {
const PendingChatbotMessages: FC<{ username: string }> = ({ username }) => {
const { useListChatbots } = useUser({ id: username });

const { response } = useListChatbots();
Expand Down Expand Up @@ -211,6 +209,7 @@ const LoggedInChatApp: FC<{ username: string; handleLogout: () => void }> = ({
reactions={{}}
pending={true}
key={message.idempotencyKey}
timestamp={new Date().toLocaleString()}
/>
))}
{Object.keys(messages)
Expand Down
2 changes: 1 addition & 1 deletion web/src/ChatMessage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ const ChatMessage: FC<{
.sort((left, right) => {
return left[0].localeCompare(right[0]);
})
.map(([reaction, { users }]) => (
.map(([reaction, { users }]: any) => (

Copilot AI Aug 13, 2025

Copy link

Choose a reason for hiding this comment

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

Using 'any' type defeats TypeScript's type safety. Consider defining a proper interface for the reactions object structure, such as 'Record<string, { users: Record<string, any> }>' or a more specific type based on the actual data structure.

Suggested change
.map(([reaction, { users }]: any) => (
.map(([reaction, { users }]) => (

Copilot uses AI. Check for mistakes.
<Reaction
reaction={[reaction, Object.keys(users).length]}
messageId={id}
Expand Down
4 changes: 4 additions & 0 deletions web/src/ReactionWindow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ const dateFromUUIDv7 = (uuid: string): Date => {
const ReactionsWindow: FC<{}> = () => {
const username = localStorage.getItem("username");

if (username === null) {
throw new Error("Username not found in localStorage");

Copilot AI Aug 13, 2025

Copy link

Choose a reason for hiding this comment

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

The error message should be more descriptive and user-friendly. Consider providing context about what the user should do, such as 'User session expired. Please log in again.' or redirect to login instead of throwing an error.

Suggested change
throw new Error("Username not found in localStorage");
// Redirect to login page if username is not found
return <Navigate to="/login" replace />;

Copilot uses AI. Check for mistakes.
}

const [limit, setLimit] = useState(40);
const { useMessagesReactions } = useUser({ id: username });

Expand Down
5 changes: 4 additions & 1 deletion web/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@ import ReactDOM from "react-dom/client";
import App from "./App.tsx";
import "./index.css";

const url =
import.meta.env.VITE_APP_CHAT_REBOOT_ENDPOINT || "http://localhost:9991";

ReactDOM.createRoot(document.getElementById("root")!).render(
<React.StrictMode>
<RebootClientProvider url={"http://localhost:9991"}>
<RebootClientProvider url={url}>
<App />
</RebootClientProvider>
</React.StrictMode>
Expand Down