Skip to content

Commit 26e1be9

Browse files
committed
homepage: fixes & glow up
1 parent 36bea05 commit 26e1be9

File tree

7 files changed

+52
-23
lines changed

7 files changed

+52
-23
lines changed

hyperdrive/packages/homepage/ui/src/components/Chat/Message.css

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,25 @@
2121
}
2222
}
2323

24+
/* Own message "rise from input" animation */
25+
@keyframes message-send {
26+
0% {
27+
opacity: 0;
28+
transform: translateY(40px) scale(0.92);
29+
}
30+
60% {
31+
opacity: 1;
32+
}
33+
100% {
34+
opacity: 1;
35+
transform: translateY(0) scale(1);
36+
}
37+
}
38+
39+
.message.own:not(.no-animate) {
40+
animation: message-send 0.35s cubic-bezier(0.22, 1, 0.36, 1) forwards;
41+
}
42+
2443
/* Disable animation for messages already in view on load */
2544
.message.no-animate {
2645
animation: none;

hyperdrive/packages/homepage/ui/src/components/Chat/MessageInput.css

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,17 @@
218218
box-shadow: none;
219219
}
220220

221+
/* Send pulse on input container */
222+
@keyframes input-send-pulse {
223+
0% { transform: scale(1); }
224+
30% { transform: scale(0.97); }
225+
100% { transform: scale(1); }
226+
}
227+
228+
.message-input-container.just-sent {
229+
animation: input-send-pulse 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
230+
}
231+
221232
/* Recording state */
222233
.message-input-container.recording .message-input {
223234
border-color: #ff4444;

hyperdrive/packages/homepage/ui/src/components/Chat/MessageInput.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ const MessageInput: React.FC<MessageInputProps> = ({ chatId, onSendMessage }) =>
1616
const [showVoiceNote, setShowVoiceNote] = useState(false);
1717
const { sendMessage, replyingTo, setReplyingTo, editingMessage, setEditingMessage, editMessage } = useChatStore();
1818
const inputRef = useRef<HTMLTextAreaElement>(null);
19+
const containerRef = useRef<HTMLDivElement>(null);
1920

2021
// Detect if user is on mobile device (avoid touch-enabled laptops)
2122
const isMobile = /iPhone|iPad|iPod|Android/i.test(navigator.userAgent);
@@ -55,6 +56,11 @@ const MessageInput: React.FC<MessageInputProps> = ({ chatId, onSendMessage }) =>
5556
setReplyingTo(null);
5657
await sendMessage(chatId, messageText, replyToId);
5758
onSendMessage?.();
59+
// Trigger send pulse animation on input container
60+
if (containerRef.current) {
61+
containerRef.current.classList.add('just-sent');
62+
setTimeout(() => containerRef.current?.classList.remove('just-sent'), 350);
63+
}
5864
}
5965
inputRef.current?.focus();
6066
}
@@ -119,7 +125,7 @@ const MessageInput: React.FC<MessageInputProps> = ({ chatId, onSendMessage }) =>
119125
</div>
120126
)}
121127

122-
<div className={`message-input-container ${editingMessage ? 'editing' : ''}`}>
128+
<div ref={containerRef} className={`message-input-container ${editingMessage ? 'editing' : ''}`}>
123129
{!editingMessage && (
124130
<div className="message-actions">
125131
<button

hyperdrive/packages/homepage/ui/src/components/Settings/ProfileSettings.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
.save-button {
1414
background: var(--primary-color);
15-
color: white;
15+
color: #000;
1616
border: none;
1717
padding: 12px 24px;
1818
border-radius: 8px;

hyperdrive/packages/homepage/ui/src/components/Settings/SettingsModal.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
overflow: hidden;
88
display: flex;
99
flex-direction: column;
10+
align-self: flex-start;
11+
margin-top: 10vh;
1012
}
1113

1214
.settings-header {

hyperdrive/packages/homepage/ui/src/components/SplashScreen/SplashScreen.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@ const SplashScreen: React.FC<SplashScreenProps> = ({
2020
<div className="splash-header">
2121
<ProfileButton onClick={() => setShowSettings(true)} />
2222
<h1 className="app-title">Chats</h1>
23-
<button className="header-action" aria-label="New chat">
24-
<span className="material-symbols-outlined">edit_square</span>
25-
</button>
23+
<div style={{ width: 40 }} />
2624
</div>
2725

2826
<div className="splash-content">

hyperdrive/packages/homepage/ui/src/homepage/components/AppDrawer.tsx

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { useAppStore } from '../stores/appStore';
44
import { useNavigationStore } from '../stores/navigationStore';
55
import { usePersistenceStore } from '../stores/persistenceStore';
66
import { AppIcon } from './AppIcon';
7-
import { BsSearch, BsX } from 'react-icons/bs';
7+
import ChatSearch from '../../components/Chats/ChatSearch';
88
import classNames from 'classnames';
99

1010
interface AppDrawerProps {
@@ -56,22 +56,7 @@ export const AppDrawer: React.FC<AppDrawerProps> = ({
5656
className={`app-drawer fixed inset-0 bg-gradient-to-b from-gray-100/20 to-white/20 dark:from-gray-900/20 dark:to-black/20 backdrop-blur-xl ${zIndexClass} ${dockedClass} flex flex-col animate-modal-backdrop`}
5757
onClick={handleBackdropClick}
5858
>
59-
<div className="px-2 py-1 self-stretch flex items-center gap-2">
60-
<h2 className="prose">My Apps</h2>
61-
<div className="bg-black/10 dark:bg-white/10 flex items-center gap-2 ml-auto max-w-sm grow self-stretch rounded-lg pl-2">
62-
<BsSearch className="opacity-50" />
63-
<input
64-
type="text"
65-
placeholder="Search apps..."
66-
value={searchQuery}
67-
onChange={(e) => setSearchQuery(e.target.value)}
68-
className="grow self-stretch !bg-transparent !p-0"
69-
autoFocus={!isMobile}
70-
/>
71-
</div>
72-
</div>
73-
74-
<div className="flex-1 overflow-y-auto p-4">
59+
<div className="flex-1 overflow-y-auto overflow-x-hidden pt-16 px-6">
7560
<div className={classNames(`
7661
grid
7762
gap-4 md:gap-6 lg:gap-8
@@ -98,7 +83,7 @@ export const AppDrawer: React.FC<AppDrawerProps> = ({
9883
{!homeScreenApps.includes(app.id) && (
9984
<button
10085
onClick={() => handleAddToHome(app)}
101-
className="absolute -top-3 -right-3 w-8 h-8 rounded-full thin"
86+
className="absolute -top-1 -right-1 w-6 h-6 rounded-full thin text-xs"
10287
>
10388
+
10489
</button>
@@ -125,6 +110,14 @@ export const AppDrawer: React.FC<AppDrawerProps> = ({
125110
)}
126111
</div>
127112
</div>
113+
114+
<div className="px-4 py-4 flex-shrink-0">
115+
<ChatSearch
116+
value={searchQuery}
117+
onChange={setSearchQuery}
118+
placeholder="Search apps..."
119+
/>
120+
</div>
128121
</div>
129122
);
130123
};

0 commit comments

Comments
 (0)