Skip to content

Feature/dashboard - #74

Merged
MonkyMars merged 7 commits into
mainfrom
feature/dashboard
Oct 8, 2025
Merged

Feature/dashboard#74
MonkyMars merged 7 commits into
mainfrom
feature/dashboard

Conversation

@MonkyMars

@MonkyMars MonkyMars commented Oct 8, 2025

Copy link
Copy Markdown
Owner

IMPORTANT: Use this template for all PRs to ensure consistency.

You can remove sections that do not apply to your change.

Description & Motivation

Improves the lacking dashboard, not done completely.

Related Issues

Relates to #38

(Only include “Closes” for issues you intend this PR to fully resolve.)

Scope of Change

(Mark or list the relevant ones)

  • New feature
  • Bug fix
  • Refactor / cleanup
  • Documentation
  • Breaking change

@MonkyMars MonkyMars self-assigned this Oct 8, 2025
Copilot AI review requested due to automatic review settings October 8, 2025 22:14
@MonkyMars MonkyMars added enhancement New feature or request react/ui Updates the react UI go/fiber Updates the go fiber server labels Oct 8, 2025

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 improves the dashboard functionality with enhanced subject management, file/folder organization, and comprehensive keyboard navigation features.

  • Enhanced dashboard with real-time search, keyboard shortcuts, and improved subject cards
  • Implemented folder-based file organization with navigation breadcrumbs
  • Added comprehensive keyboard shortcuts for both dashboard and subject detail views

Reviewed Changes

Copilot reviewed 38 out of 45 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
apps/ui/app/types/subject.ts Updated Subject interface to remove description field and add folder support
apps/ui/app/hooks/use-subjects.ts Enhanced hooks to support folder navigation and updated API endpoints
apps/ui/app/components/subjects/subject-detail.tsx Major overhaul with folder navigation, keyboard shortcuts, and improved UI
apps/ui/app/components/dashboard/dashboard.tsx Added search functionality with keyboard shortcuts and improved filtering
apps/server/services/subject_service.go New service for subject management with database queries
apps/server/api/routes/subjects.go New API routes for subject operations
Files not reviewed (4)
  • apps/server/.idea/.gitignore: Language not supported
  • apps/server/.idea/modules.xml: Language not supported
  • apps/server/.idea/server.iml: Language not supported
  • apps/server/.idea/vcs.xml: Language not supported

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

Comment on lines +124 to +127
if (!response.success || !response.data) {
throw new Error(response.message || 'Fout bij ophalen bestanden');
}

Copilot AI Oct 8, 2025

Copy link

Choose a reason for hiding this comment

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

Duplicate error checking logic. The same validation is performed on lines 120-122, making this check redundant.

Suggested change
if (!response.success || !response.data) {
throw new Error(response.message || 'Fout bij ophalen bestanden');
}

Copilot uses AI. Check for mistakes.
Comment on lines +114 to 115
<iframe
src={file.url}

Copilot AI Oct 8, 2025

Copy link

Choose a reason for hiding this comment

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

Changed from img to iframe for displaying images. This will not work correctly for image files as iframes are meant for embedding documents, not displaying images directly.

Suggested change
<iframe
src={file.url}
<img
src={file.url}
alt={file.name}

Copilot uses AI. Check for mistakes.
Comment on lines +188 to +189
const file = await fetch(`https://drive.usercontent.google.com/download?id=${item.fileId}`);
const blob = await file.blob();

Copilot AI Oct 8, 2025

Copy link

Choose a reason for hiding this comment

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

Direct URL construction for Google Drive downloads without proper authentication or validation. This could expose file IDs and may not work reliably without proper authorization headers.

Suggested change
const file = await fetch(`https://drive.usercontent.google.com/download?id=${item.fileId}`);
const blob = await file.blob();
// Fetch the file from a secure backend endpoint that handles Google Drive authentication
const response = await fetch(`/api/download-file?fileId=${encodeURIComponent(item.fileId)}`);
if (!response.ok) {
alert('Kan bestand niet ophalen. Controleer uw rechten of probeer het later opnieuw.');
return;
}
const blob = await response.blob();

Copilot uses AI. Check for mistakes.
Comment on lines +96 to +97
// DEFAULT to DISTINCT to avoid duplicates
pgQuery = pgQuery.Distinct()

Copilot AI Oct 8, 2025

Copy link

Choose a reason for hiding this comment

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

Applying DISTINCT to all SELECT queries by default can significantly impact performance, especially on large datasets. This should only be applied when necessary to avoid duplicates.

Suggested change
// DEFAULT to DISTINCT to avoid duplicates
pgQuery = pgQuery.Distinct()
// Apply DISTINCT only if requested or if JOINs are present (handled below)
// pgQuery = pgQuery.Distinct()

Copilot uses AI. Check for mistakes.
{searchValue && filteredSubjects.length > 0 && (
<div
className="flex items-center px-1.5 py-0.5 bg-neutral-100 rounded text-xs text-neutral-500"
title="Druk Enter om naar eerste resultaat te gaan"

Copilot AI Oct 8, 2025

Copy link

Choose a reason for hiding this comment

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

Corrected Dutch text: 'Druk' should be 'Druk op' for proper grammar.

Copilot uses AI. Check for mistakes.
printWindow.focus();
printWindow.print();
} else {
alert('Pop-up geblokkeerd. Sta pop-ups toe om te kunnen printen.');

Copilot AI Oct 8, 2025

Copy link

Choose a reason for hiding this comment

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

Using alert() for user notifications is outdated and provides poor user experience. Consider using a toast notification or modal dialog instead.

Copilot uses AI. Check for mistakes.
@MonkyMars
MonkyMars merged commit 725c874 into main Oct 8, 2025
12 checks passed
@MonkyMars
MonkyMars deleted the feature/dashboard branch October 8, 2025 22:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request go/fiber Updates the go fiber server react/ui Updates the react UI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants