Skip to content

Fixes#43

Merged
dev-banane merged 6 commits intomainfrom
fixes
Oct 23, 2025
Merged

Fixes#43
dev-banane merged 6 commits intomainfrom
fixes

Conversation

@dev-banane
Copy link
Copy Markdown
Member

No description provided.

@1ceit 1ceit requested a review from Copilot October 23, 2025 15:06
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements various UI improvements and bug fixes across multiple components, focusing on enhancing user experience through better formatting, debouncing, and mobile responsiveness.

Key changes include:

  • Refactored Home page CTA section with new background styling and removed video embed
  • Added debouncing to DepartureTable input fields (callsign, stand, squawk) to reduce unnecessary updates
  • Enhanced AcarsChartDrawer with search functionality and mobile-optimized split view
  • Improved code formatting and readability across multiple components
  • Fixed activity time tracking logic in session users websocket to prevent double-counting

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/pages/Home.tsx Redesigned CTA section with new background image handling and simplified layout
src/pages/ACARS.tsx Improved header responsive layout and replaced custom buttons with Button component
src/components/tools/Toolbar.tsx Removed connection status text display
src/components/tools/ContactAcarsSidebar.tsx Added Enter key handler for sending messages
src/components/tools/ChatSidebar.tsx Removed online user count display and adjusted message bubble max width
src/components/tables/DepartureTable.tsx Implemented debouncing for callsign, stand, and squawk inputs to improve performance
src/components/buttons/UserButton.tsx Code formatting improvements and removed unused Link import
src/components/acars/AcarsChartDrawer.tsx Added search functionality and mobile-responsive chart viewing
src/components/Navbar.tsx Removed duplicate navigation links from mobile menu
server/websockets/sessionUsersWebsocket.ts Fixed activity time calculation to prevent double-counting

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread src/pages/Home.tsx
Comment on lines +614 to +624
<div
className="absolute inset-0"
style={{
backgroundImage,
backgroundSize: 'cover',
backgroundPosition: 'center',
backgroundRepeat: 'no-repeat',
opacity: customLoaded ? 1 : 0,
transition: 'opacity 0.5s ease-in-out',
}}
/>
Copy link

Copilot AI Oct 23, 2025

Choose a reason for hiding this comment

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

The variable backgroundImage is referenced but not defined or imported in this file. This will cause a runtime error. Ensure backgroundImage is properly defined or imported.

Suggested change
<div
className="absolute inset-0"
style={{
backgroundImage,
backgroundSize: 'cover',
backgroundPosition: 'center',
backgroundRepeat: 'no-repeat',
opacity: customLoaded ? 1 : 0,
transition: 'opacity 0.5s ease-in-out',
}}
/>
{/*
Define backgroundImage as a valid CSS background-image value.
*/}
{/*
If you want to use a dynamic image, replace the path below with your dynamic value.
*/}
{(() => {
const backgroundImage = "url('/assets/images/hero.webp')";
return (
<div
className="absolute inset-0"
style={{
backgroundImage,
backgroundSize: 'cover',
backgroundPosition: 'center',
backgroundRepeat: 'no-repeat',
opacity: customLoaded ? 1 : 0,
transition: 'opacity 0.5s ease-in-out',
}}
/>
);
})()}

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

backgroundImage is defined, already used in the hero section

Comment thread src/pages/Home.tsx
backgroundSize: 'cover',
backgroundPosition: 'center',
backgroundRepeat: 'no-repeat',
opacity: customLoaded ? 1 : 0,
Copy link

Copilot AI Oct 23, 2025

Choose a reason for hiding this comment

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

The variable customLoaded is referenced but not defined or imported in this file. This will cause a runtime error. Ensure customLoaded is properly defined or imported.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

customLoaded is a state 🤨

const [squawkValues, setSquawkValues] = useState<
Record<string | number, string>
>({});
const debounceTimeouts = useRef<Record<string | number, NodeJS.Timeout>>({});
Copy link

Copilot AI Oct 23, 2025

Choose a reason for hiding this comment

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

The debounceTimeouts ref is shared across all three debounced functions (remark, callsign, stand, squawk), which can cause race conditions when multiple fields are edited simultaneously. Each debounced function should have its own timeout ref to prevent interference.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

users can't edit multiple fields at a time

const now = Date.now();
const activeTime = Math.max(0, now - entry.sessionStart - (5 * 60 * 1000));
entry.totalActive += activeTime / 60000;
const remainingActiveTime = Math.max(0, (now - entry.lastActive) / 60000 - 0.1);
Copy link

Copilot AI Oct 23, 2025

Choose a reason for hiding this comment

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

The magic number 0.1 (6 seconds) is used without explanation. Consider defining this as a named constant (e.g., DISCONNECT_BUFFER_MINUTES) with a comment explaining why this buffer is necessary.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Collaborator

@1ceit 1ceit left a comment

Choose a reason for hiding this comment

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

This better look good or you leave me no choice....

Comment thread src/components/Navbar.tsx
Comment on lines -503 to -526
<div className="py-2">
<a
href="/create"
className="block px-6 py-3 text-gray-300 hover:text-white hover:bg-blue-600/20 transition-all duration-200 font-medium"
onClick={() => setIsMenuOpen(false)}
>
Create Session
</a>
<a
href="/sessions"
className="block px-6 py-3 text-gray-300 hover:text-white hover:bg-blue-600/20 transition-all duration-200 font-medium"
onClick={() => setIsMenuOpen(false)}
>
My Sessions
</a>
<a
href="/pfatc"
className="block px-6 py-3 text-gray-300 hover:text-white hover:bg-blue-600/20 transition-all duration-200 font-medium"
onClick={() => setIsMenuOpen(false)}
>
PFATC Flights
</a>
</div>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Am I missing something?

No flight information available
</div>
)}
{searchQuery &&
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Search bar is nice

Comment on lines -457 to -462
<span
id="connection-status"
className={`text-xs ${getStatusColor()}`}
>
{connectionStatus}
</span>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Don't we want this?

Comment thread src/pages/ACARS.tsx
Comment on lines +580 to +588
<Button
variant="outline"
size="sm"
className="gap-2"
onClick={() => navigate(`/submit/${sessionId}`)}
className="group relative flex items-center gap-2 px-4 py-2.5 rounded-xl border transition-all duration-200 bg-gradient-to-r from-zinc-500/20 to-black-500/20 border-zinc-500/40 hover:border-purple-400/60 shadow-lg shadow-purple-950/10"
>
<PlusCircle className="w-5 h-5 text-purple-400" />
<span className="hidden sm:inline text-sm font-medium">
New Flight
</span>
</button>
<button
onClick={handleToggleSidebar}
className={`group relative flex items-center gap-2 px-4 py-2.5 rounded-xl border transition-all duration-200 ${
showSidebar
? 'bg-gradient-to-r from-blue-500/20 to-blue-600/20 border-blue-500/40 hover:border-blue-400/60 shadow-lg shadow-blue-500/10'
: 'bg-gradient-to-r from-zinc-800/50 to-zinc-900/50 border-zinc-700/50 hover:border-zinc-600 hover:bg-zinc-800/70'
}`}
>
<PlusCircle className="w-5 h-5" />
<span className="hidden sm:inline">New Flight</span>
</Button>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nooooooo..... fuck your buttons. This shit better look better that I had it

@dev-banane dev-banane merged commit 6b81105 into main Oct 23, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants