Skip to content

Commit 5071615

Browse files
error9098xluarss
andauthored
feat: connect new backend conversation with frontend (#182)
* Added frontend * fix `/conversations` payload * remove prettier from build * fix dark mode * fix suggestedquestions * fix conversation ui - backend: order messages by created_at - fix conversations payload * add confirmation prompt before deletion --------- Signed-off-by: error9098x <[email protected]> Signed-off-by: Jack Luar <[email protected]> Co-authored-by: Jack Luar <[email protected]>
1 parent d7f3827 commit 5071615

File tree

11 files changed

+8642
-803
lines changed

11 files changed

+8642
-803
lines changed

backend/src/database/models.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@ class Conversation(Base):
2424
)
2525

2626
messages: Mapped[list["Message"]] = relationship(
27-
"Message", back_populates="conversation", cascade="all, delete-orphan"
27+
"Message",
28+
back_populates="conversation",
29+
cascade="all, delete-orphan",
30+
order_by="Message.created_at",
2831
)
2932

3033
def __repr__(self) -> str:

frontend/nextjs-frontend/app/globals.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
@import 'tailwindcss';
22

3+
/* Enable class-based dark mode for Tailwind v4 */
4+
@variant dark (&:where(.dark, .dark *));
5+
36
:root {
47
--foreground-rgb: 0, 0, 0;
58
--background-start-rgb: 255, 255, 255;

frontend/nextjs-frontend/app/layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export default function RootLayout({
1919
return (
2020
<html lang="en" suppressHydrationWarning>
2121
<body className={inter.className}>
22-
<ThemeProvider attribute="class" defaultTheme="light">
22+
<ThemeProvider attribute="class" defaultTheme="system" enableSystem>
2323
<Header />
2424
{children}
2525
</ThemeProvider>

0 commit comments

Comments
 (0)