Skip to content

feat: stabilize chat realtime, dashboard insights, and account flows#57

Open
0x3EF8 wants to merge 1 commit intohallofcodes:masterfrom
0x3EF8:master
Open

feat: stabilize chat realtime, dashboard insights, and account flows#57
0x3EF8 wants to merge 1 commit intohallofcodes:masterfrom
0x3EF8:master

Conversation

@0x3EF8
Copy link
Copy Markdown
Member

@0x3EF8 0x3EF8 commented Mar 26, 2026

Summary

  • improve chat reliability and UX: presence accuracy, read/typing signals, unread tracking, media viewer flow, and conversation handling
  • enhance dashboard and settings experience, including WakaTime sync and account management improvements
  • refresh landing and leaderboard presentation for clearer user flow and better readability
  • add and clean Supabase migrations for cascade delete behavior, chat presence/read tracking, realtime publication, global chat membership, and dashboard snapshots

Review Follow-ups Addressed

  • removed BOM bytes in chat components where required
  • removed duplicate hideHint declaration and cleaned unused imports
  • memoized heavy derived media lists and split concatenated state declarations
  • reverted unintended desktop navbar collapse default
  • restored cached user/profile helper behavior
  • improved migration formatting/comments and removed unnecessary .gitignore noise

Commit History

  • squashed into one clean commit to avoid dirty commit records in history

Copilot AI review requested due to automatic review settings March 29, 2026 10:58
Copy link
Copy Markdown
Contributor

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 updates the chat experience with improved conversation ordering and richer UI (badges/media viewing), and adds database-level cascade deletes to support safe conversation deletion.

Changes:

  • Add DM sorting controls (newest/oldest/A–Z/Z–A), message search, and revamped chat layout with left/right sidebars.
  • Restore/standardize rank badge styling/animations by moving badge CSS into app/globals.css and using class-based badges + icons.
  • Add a Supabase migration to enforce ON DELETE CASCADE for messages and conversation_participants when deleting a conversation.

Reviewed changes

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

Show a summary per file
File Description
supabase/migrations/20260327100000_cascade_conversation_delete.sql Adds cascade FK constraints for conversation cleanup on delete.
package.json Bumps @fortawesome/react-fontawesome to support updated icon usage.
package-lock.json Updates lockfile to reflect dependency bump and npm resolution changes.
app/globals.css Centralizes badge keyframes/styles so they’re shared across UI.
app/components/dashboard/Navbar.tsx Changes default sidebar collapse behavior (desktop now collapsed).
app/components/chat/Player.tsx Adds hint-hiding helper (currently introduces a duplicate declaration).
app/components/chat/Messages.tsx Adds media navigation controls + updated badge rendering with icons.
app/components/chat/Conversations.tsx Updates conversation list item layout/labels/initials.
app/components/LeaderboardTable.tsx Removes inline injected badge CSS now that globals provide styles.
app/components/Chat.tsx Major chat UI refactor: sorting/search, sidebars, media viewer, deletion flow, badge icon mapping.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +83 to +88
const hideHint = () => {
if (hintTimeoutRef.current) window.clearTimeout(hintTimeoutRef.current);
setActiveHint(null);
setHintPos(null);
};

Copy link

Copilot AI Mar 29, 2026

Choose a reason for hiding this comment

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

hideHint is declared twice in this component (there is another const hideHint = ... later in the file). This will cause a TypeScript compile error due to redeclaration. Remove one of the declarations and keep a single hideHint implementation.

Suggested change
const hideHint = () => {
if (hintTimeoutRef.current) window.clearTimeout(hintTimeoutRef.current);
setActiveHint(null);
setHintPos(null);
};

Copilot uses AI. Check for mistakes.
@@ -1,23 +1,49 @@
"use client";
"use client";
Copy link

Copilot AI Mar 29, 2026

Choose a reason for hiding this comment

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

There is a leading BOM/zero-width character before the "use client" directive. Next.js requires the directive to be the very first bytes in the file; the BOM can prevent the component from being treated as a client component. Remove the BOM so the file starts exactly with "use client";.

Suggested change
"use client";
"use client";

Copilot uses AI. Check for mistakes.
@@ -1,4 +1,4 @@
import { User } from "@supabase/supabase-js";
import { User } from "@supabase/supabase-js";
Copy link

Copilot AI Mar 29, 2026

Choose a reason for hiding this comment

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

This file starts with a BOM/zero-width character before the first import. While it may not break runtime behavior, it commonly causes noisy diffs and occasional tooling issues. Please remove the BOM so the file begins with a normal import ....

Suggested change
import { User } from "@supabase/supabase-js";
import { User } from "@supabase/supabase-js";

Copilot uses AI. Check for mistakes.
Comment on lines 199 to 201
// default to collapsed on desktop too
setCollapsed(true);
setMobileHidden(false);
Copy link

Copilot AI Mar 29, 2026

Choose a reason for hiding this comment

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

This change makes the sidebar default to collapsed on desktop as well as mobile. Since the PR is focused on chat ordering/cascade delete, this looks like an unrelated UX change; if it is intentional, it should be called out in the PR description (or moved to a separate PR) to avoid surprising behavior changes.

Copilot uses AI. Check for mistakes.
@@ -1,4 +1,4 @@
"use client";
"use client";
Copy link

Copilot AI Mar 29, 2026

Choose a reason for hiding this comment

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

There is a leading BOM/zero-width character before the "use client" directive. Next.js requires the directive to be the very first bytes in the file; the BOM can prevent the component from being treated as a client component. Remove the BOM so the file starts exactly with "use client";.

Suggested change
"use client";
"use client";

Copilot uses AI. Check for mistakes.
const [showModal, setShowModal] = useState(false);
const [search, setSearch] = useState("");
const [allUsers, setAllUsers] = useState<ChatUser[]>([]);
const [search, setSearch] = useState(""); const [messageSearch, setMessageSearch] = useState(""); const [allUsers, setAllUsers] = useState<ChatUser[]>([]);
Copy link

Copilot AI Mar 29, 2026

Choose a reason for hiding this comment

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

These state declarations appear to have been accidentally concatenated onto a single line, which hurts readability and makes future diffs harder to review. Please split them into separate const declarations on their own lines.

Suggested change
const [search, setSearch] = useState(""); const [messageSearch, setMessageSearch] = useState(""); const [allUsers, setAllUsers] = useState<ChatUser[]>([]);
const [search, setSearch] = useState("");
const [messageSearch, setMessageSearch] = useState("");
const [allUsers, setAllUsers] = useState<ChatUser[]>([]);

Copilot uses AI. Check for mistakes.
Comment on lines +13 to +16
faEllipsisVertical,
faFlag,
faLock,
faGhost,
Copy link

Copilot AI Mar 29, 2026

Choose a reason for hiding this comment

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

Several icons are imported here but never referenced in the file (e.g. faEllipsisVertical, faFlag, faLock). This will fail linting in many configurations and adds noise. Remove unused imports or wire them up where intended.

Suggested change
faEllipsisVertical,
faFlag,
faLock,
faGhost,

Copilot uses AI. Check for mistakes.
Comment on lines +633 to +638
const allMediaAttachments = messages
.flatMap((m) => m.attachments || [])
.filter(
(a) => a?.mimetype?.startsWith("image/") || a?.mimetype?.startsWith("video/")
)
.reverse();
Copy link

Copilot AI Mar 29, 2026

Choose a reason for hiding this comment

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

allMediaAttachments is rebuilt (including a .reverse()) on every render. With long message histories this can become a noticeable cost. Consider memoizing this derived list with useMemo (and potentially sharing the media-viewer logic with Messages to avoid duplicated implementations).

Copilot uses AI. Check for mistakes.
@0x3EF8 0x3EF8 changed the title feat(chat): add chat ordering enhancements and cascade delete migration feat: improve chat, dashboard, landing page, settings, and account completion Mar 29, 2026
Copy link
Copy Markdown
Member

@mrepol742 mrepol742 left a comment

Choose a reason for hiding this comment

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

Please ammend the commit to prevent dirty commits/records from the git history.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

the spacing for these files are necessary to ensure its readable

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.

Addressed in commit f49ed2f. I reformatted this migration with clearer spacing/newlines for readability.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

the spacing for these files are necessary to ensure its readable

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.

Addressed in commit f49ed2f. I reformatted this migration with clearer spacing/newlines for readability.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

the spacing for these files are necessary to ensure its readable

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.

Addressed in commit f49ed2f. I reformatted this migration with clearer spacing/newlines for readability.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

the spacing for these files are necessary to ensure its readable

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.

Addressed in commit f49ed2f. I reformatted this migration with clearer spacing/newlines for readability.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

the spacing for these files are necessary to ensure its readable

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.

Addressed in commit f49ed2f. I reformatted this migration with clearer spacing/newlines for readability.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

the supabase/.temp folder is already ignored and unnecessary to be written.

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.

Addressed in commit f49ed2f. I removed the unnecessary supabase/.temp ignore noise and kept the .gitignore clean.

0x3EF8 added a commit to 0x3EF8/devpulse that referenced this pull request Apr 1, 2026
Consolidates PR hallofcodes#57 changes into a clean commit history.

Includes reviewer follow-ups for chat presence, BOM cleanup, migration readability, and lint/build fixes.
@0x3EF8 0x3EF8 changed the title feat: improve chat, dashboard, landing page, settings, and account completion feat: stabilize chat realtime, dashboard insights, and account flows Apr 1, 2026
0x3EF8 added a commit to 0x3EF8/devpulse that referenced this pull request Apr 1, 2026
Refines PR hallofcodes#57 into a single clean commit covering chat, dashboard, landing, settings, and migration updates.

Includes reviewer follow-ups for BOM cleanup, component fixes, migration readability, and history hygiene.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This browser check is required to ensure the client is not using puppeter or dummy browser for automation.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

the spacing for these files are necessary to ensure its readable

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please make sure to aligned with the project designed and avoid using 3rd party or inlined SVG. For this SVG Back button,please sure the FontAwesome Chevron Left.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please make sure to aligned with the project designed and avoid using 3rd party or inlined SVG. For this SVG Back button,please sure the FontAwesome Chevron Left.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

the route file (e.g. route.ts) should stay focused on handling the request/response lifecycle (GET, POST, etc.), not business logic or data transformation. Please refractor this to util folder.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

the 'best practices' is should not be there as it should be part of FAQ.

<div className="glass-card p-5 border-t-4 border-indigo-500/40">
              <h3 className="text-xs font-semibold text-indigo-300 uppercase tracking-widest mb-3">
                Best Practices
              </h3>
              <div className="space-y-2 text-xs md:text-sm text-gray-400 leading-relaxed">
                <p>Rotate API keys periodically and avoid sharing them in screenshots.</p>
                <p>Use a strong password and reset it immediately if account activity looks unusual.</p>
                <p>After changing your API key, run a dashboard sync to refresh your metrics.</p>
              </div>
            </div>
  • changing the api should not forced the system to update the coding metrics to avoid API call and charges in vercel and supabase
  • rotating the api keys periodically is not ideal as if the API key rotates the user needs to update the API key not just in our system but also on his/her devices and other 3rd party services connected or integrated to Wakatime.
  • in terms of using a strong password, supabase automatically checks the password strength and if the password is common or in data leaks.

0x3EF8 added a commit to 0x3EF8/devpulse that referenced this pull request Apr 1, 2026
Refines PR hallofcodes#57 into a single clean commit covering chat, dashboard, landing, settings, and migration updates.

Includes reviewer follow-ups for BOM cleanup, component fixes, migration readability, and history hygiene.
0x3EF8 added a commit to 0x3EF8/devpulse that referenced this pull request Apr 1, 2026
Refines PR hallofcodes#57 into a single clean commit covering chat, dashboard, landing, settings, and migration updates.

Includes reviewer follow-ups for BOM cleanup, component fixes, migration readability, and history hygiene.
0x3EF8 added a commit to 0x3EF8/devpulse that referenced this pull request Apr 1, 2026
Refines PR hallofcodes#57 into a single clean commit covering chat, dashboard, landing, settings, and migration updates.

Includes reviewer follow-ups for BOM cleanup, component fixes, migration readability, and history hygiene.
0x3EF8 added a commit to 0x3EF8/devpulse that referenced this pull request Apr 1, 2026
Refines PR hallofcodes#57 into a single clean commit covering chat, dashboard, landing, settings, and migration updates.

Includes reviewer follow-ups for BOM cleanup, component fixes, migration readability, and history hygiene.
0x3EF8 added a commit to 0x3EF8/devpulse that referenced this pull request Apr 1, 2026
Refines PR hallofcodes#57 into a single clean commit covering chat, dashboard, landing, settings, and migration updates.

Includes reviewer follow-ups for BOM cleanup, component fixes, migration readability, and history hygiene.
0x3EF8 added a commit to 0x3EF8/devpulse that referenced this pull request Apr 1, 2026
Refines PR hallofcodes#57 into a single clean commit covering chat, dashboard, landing, settings, and migration updates.

Includes reviewer follow-ups for BOM cleanup, component fixes, migration readability, and history hygiene.
0x3EF8 added a commit to 0x3EF8/devpulse that referenced this pull request Apr 1, 2026
Refines PR hallofcodes#57 into a single clean commit covering chat, dashboard, landing, settings, and migration updates.

Includes reviewer follow-ups for BOM cleanup, component fixes, migration readability, and history hygiene.
@0x3EF8 0x3EF8 force-pushed the master branch 5 times, most recently from 45f23e4 to 5b9f4cd Compare April 1, 2026 22:39
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