Refactor user roles and enhance dashboard with new features#34
Merged
Conversation
- Unified user model to replace separate Seller and Bidder roles. - Updated documentation and UI to reflect changes to User Dashboard. - Implemented UserDashboardController for managing auctions and bids. - Adjusted FXML files and CSS for new user interface elements. - Enhanced error handling in LoginController for admin troubleshooting. - Updated project timeline and task classifications to align with new structure.
…user dashboard, and auction details
…troduce load testing utility class.
Merge/features member2
…uted-Auction-System into add-codeql-quality-checker
Add codeql quality checker
…and repository unit tests
feat: implement database management layer, auction service skeleton, …
There was a problem hiding this comment.
Pull request overview
This PR advances the ongoing role refactor to a unified ADMIN / USER model and updates the JavaFX client UI/flow accordingly (notably replacing the seller-specific dashboard concept with a context-aware User Dashboard), alongside documentation alignment and a new CodeQL workflow.
Changes:
- Renames/rewires client navigation from
SellerDashboard→UserDashboard, and updates role wording (“Bidder/Seller” → “User/Participant”) across UI and docs. - Adds dashboard/detail-view enhancements (selected-auction context, role-based controls in detail view, improved login troubleshooting UI).
- Improves operational tooling/quality signals (in-memory DB migration guard, safer
ViewLoaderresolution, CodeQL workflow).
Reviewed changes
Copilot reviewed 29 out of 30 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| task_classification.md | Updates task ownership/labels to User Dashboard terminology. |
| src/test/java/com/auction/server/repository/BidRepositoryTest.java | Updates test users to use Constants.USER. |
| src/test/java/com/auction/server/repository/AuctionRepositoryTest.java | Updates test seller role to Constants.USER. |
| src/main/resources/fxml/user_dashboard.fxml | Switches controller/name, adds stylesheet reference, text/label updates. |
| src/main/resources/fxml/login.fxml | Major login layout refactor (currently introduces invalid FXML issues). |
| src/main/resources/fxml/auction_detail.fxml | Adds role-based control panes and renames bidder labels to user terms. |
| src/main/resources/css/login.css | Adds styling for admin troubleshooting/error panel. |
| src/main/java/com/auction/TestLoad.java | Adds a JavaFX FXML-load debug utility (should not ship in main sources). |
| src/main/java/com/auction/shared/models/User.java | Updates model docs to reflect unified user/role concept. |
| src/main/java/com/auction/server/service/AuctionServiceImpl.java | Minor comment relocation for section header. |
| src/main/java/com/auction/server/repository/DatabaseManager.java | Skips legacy migration when using SQLite :memory: (test friendliness). |
| src/main/java/com/auction/client/ui/ViewLoader.java | Adds underscore/dash fallback and explicit “view not found” error. |
| src/main/java/com/auction/client/core/ClientContext.java | Adds currentAuctionId to support detail-view context. |
| src/main/java/com/auction/client/controllers/UserDashboardController.java | Renames controller and persists selected auction ID before navigation. |
| src/main/java/com/auction/client/controllers/RegistrationController.java | Adds status label behavior + auto-login and navigation after registration (but removes a referenced handler). |
| src/main/java/com/auction/client/controllers/LoginController.java | Routes to user_dashboard.fxml and adds admin troubleshooting detail panel support. |
| src/main/java/com/auction/client/controllers/GalleryController.java | Updates back-navigation target to user_dashboard.fxml. |
| src/main/java/com/auction/client/controllers/AuctionDetailController.java | Adds role-based UI switching based on auction ownership (currently does blocking RMI on UI thread). |
| project_timeline.md | Replaces SellerDashboard naming with UserDashboard in timeline. |
| docs/ui.md | Updates view/controller mapping to authenticated-user framing and user dashboard. |
| docs/ui_design_spec.md | Renames bidder/seller sections to auction/user dashboard terminology. |
| docs/TODO.md | Reframes dashboard work as user dashboard improvements. |
| docs/table-of-contents.md | Updates headings/anchors (currently includes a duplicate entry). |
| docs/RTDAS_PRD.md | Updates PRD stories/roles to Admin/User (currently has a broken markdown table row). |
| docs/DESIGN.md | Renames bidder/seller sections to user-centric terms and updates paths. |
| docs/demo-runbook.md | Updates demo steps to standard users rather than seller/bidder split. |
| docs/database.md | Updates schema docs to ADMIN/USER wording and clarifies seller/bidder columns as contextual actors. |
| docs/abel.md | Adds a project tree doc (currently references removed/renamed controller). |
| .github/workflows/codeql.yml | Adds CodeQL scanning on push/PR/schedule for Java. |
Comments suppressed due to low confidence (3)
src/main/resources/fxml/login.fxml:18
login.fxmlis not valid FXML as written: the root element isVBox, but it still contains a<center>child (aBorderPane-only property). This will causeFXMLLoaderto fail at runtime; restructure the layout to match the chosen root (e.g., switch back toBorderPaneor remove the<center>wrapper and use standardVBoxchildren).
<VBox xmlns="http://javafx.com/javafx/17"
xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.auction.client.controllers.LoginController" styleClass="page-shell login-container" alignment="CENTER">
<center>
<VBox alignment="CENTER" spacing="18" styleClass="main-stack" maxWidth="440">
<VBox alignment="CENTER" spacing="14">
src/main/resources/fxml/user_dashboard.fxml:8
- Duplicate import in FXML (
<?import javafx.scene.layout.Region?>appears twice). Remove the redundant import to keep the FXML clean and avoid confusion during maintenance.
src/main/java/com/auction/client/ui/ViewLoader.java:47 ViewLoader.loadView()always adds/css/style.cssto theScenestylesheets. Since some views (e.g.,user_dashboard.fxml) now also declarestyle.cssin<stylesheets>, the stylesheet can be loaded twice, leading to redundant parsing and potential ordering surprises. Pick one approach (centralized inViewLoaderor per-FXML) or guard against duplicates before adding.
FXMLLoader loader = new FXMLLoader(viewUrl);
Parent root = loader.load();
Scene scene = new Scene(root);
scene.getStylesheets().add(getClass().getResource("/css/style.css").toExternalForm());
primaryStage.setScene(scene);
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+50
to
+83
| <!-- Login Card --> | ||
| <VBox styleClass="login-card"> | ||
| <!-- Terminal ID Field --> | ||
| <VBox styleClass="form-group"> | ||
| <Label text="Terminal ID" styleClass="form-label"/> | ||
| <HBox alignment="CENTER_LEFT" spacing="10" styleClass="input-field"> | ||
| <FontIcon iconLiteral="fas-user" styleClass="input-icon"/> | ||
| <TextField fx:id="usernameField" promptText="Enter your ID" HBox.hgrow="ALWAYS" style="-fx-background-color: transparent; -fx-padding: 0;"/> | ||
| </HBox> | ||
| </VBox> | ||
|
|
||
| <!-- Passkey Field --> | ||
| <VBox styleClass="form-group"> | ||
| <HBox alignment="CENTER_LEFT"> | ||
| <Label text="Passkey" styleClass="form-label"/> | ||
| </HBox> | ||
| <HBox alignment="CENTER_LEFT" spacing="10" styleClass="input-field"> | ||
| <FontIcon iconLiteral="fas-lock" styleClass="input-icon"/> | ||
| <PasswordField fx:id="passwordField" promptText="••••••••" HBox.hgrow="ALWAYS" style="-fx-background-color: transparent; -fx-padding: 0;"/> | ||
| </HBox> | ||
| </VBox> | ||
|
|
||
| <Region minHeight="10"/> | ||
|
|
||
| <!-- Action Button --> | ||
| <Button text="Enter the Auction" onAction="#handleLogin" styleClass="login-button"/> | ||
| <Label fx:id="statusLabel" styleClass="status-line" wrapText="true" alignment="CENTER" maxWidth="Infinity"/> | ||
|
|
||
| <TitledPane fx:id="adminErrorPanel" text="Admin Troubleshooting Details" expanded="false" styleClass="admin-error-pane" animated="true"> | ||
| <content> | ||
| <TextArea fx:id="adminErrorDetails" editable="false" wrapText="true" prefRowCount="7" styleClass="admin-error-area"/> | ||
| </content> | ||
| </TitledPane> | ||
| </VBox> |
Comment on lines
15
to
24
| @FXML | ||
| private void handleNavigateToLogin(javafx.scene.input.MouseEvent event) { | ||
| try { | ||
| ClientContext.getInstance().getViewLoader().loadView("login.fxml"); | ||
| } catch (IOException e) { | ||
| statusLabel.setStyle("-fx-text-fill: red;"); | ||
| statusLabel.setText("Unable to open login page: " + e.getMessage()); | ||
| e.printStackTrace(); | ||
| public void initialize() { | ||
| if (statusLabel != null) { | ||
| statusLabel.setVisible(false); | ||
| statusLabel.managedProperty().bind(statusLabel.visibleProperty()); | ||
| statusLabel.textProperty().addListener((obs, oldText, newText) -> | ||
| statusLabel.setVisible(newText != null && !newText.trim().isEmpty()) | ||
| ); | ||
| } | ||
| } |
Comment on lines
16
to
+24
| @FXML | ||
| public void initialize() { | ||
| int auctionId = ClientContext.getInstance().getCurrentAuctionId(); | ||
| if (auctionId != -1) { | ||
| try { | ||
| AuctionItem auction = ClientContext.getInstance().getRmiProvider().getService().getAuctionById(auctionId); | ||
| if (auction != null) { | ||
| String currentUsername = ClientContext.getInstance().getUsername(); | ||
| if (currentUsername.equals(auction.getSellerUsername())) { |
| - [Bidder Dashboard](#5-bidder-dashboard) | ||
| - [Seller Dashboard](#6-seller-dashboard) | ||
| - [User Dashboard](#5-user-dashboard) | ||
| - [User Dashboard](#5-user-dashboard) |
| | Database | `docs/database.md` | | ||
| | Networking | `docs/networking.md` | | ||
| | Demo Runbook | `docs/demo-runbook.md` | No newline at end of file | ||
| | Demo Runbook | `docs/demo-runbook.md` |` | No newline at end of file |
Comment on lines
+59
to
+66
| ├── controllers/ | ||
| │ ├── ConnectController.java # Server discovery UI | ||
| │ ├── LoginController.java # Authentication UI | ||
| │ ├── SellerDashboardController.java | ||
| │ ├── AdminPanelController.java | ||
| │ ├── GalleryController.java # (TODO: incomplete) | ||
| │ ├── AuctionDetailController.java # (TODO: incomplete) | ||
| │ └── RegistrationController.java |
Comment on lines
+3
to
+29
| import javafx.application.Platform; | ||
| import javafx.fxml.FXMLLoader; | ||
| import javafx.scene.Parent; | ||
| import java.net.URL; | ||
|
|
||
| public class TestLoad { | ||
| public static void main(String[] args) { | ||
| Platform.startup(() -> { | ||
| try { | ||
| URL resource = TestLoad.class.getResource("/fxml/user_dashboard.fxml"); | ||
| System.out.println("Resource: " + resource); | ||
| Parent root = FXMLLoader.load(resource); | ||
| System.out.println("Loaded successfully!"); | ||
| } catch (Exception e) { | ||
| e.printStackTrace(); | ||
| if (e.getCause() != null) { | ||
| System.out.println("CAUSE:"); | ||
| e.getCause().printStackTrace(); | ||
| if (e.getCause().getCause() != null) { | ||
| System.out.println("ROOT CAUSE:"); | ||
| e.getCause().getCause().printStackTrace(); | ||
| } | ||
| } | ||
| } | ||
| Platform.exit(); | ||
| }); | ||
| } |
Comment on lines
+41
to
45
| public int getCurrentAuctionId() { return currentAuctionId; } | ||
| public void setCurrentAuctionId(int currentAuctionId) { this.currentAuctionId = currentAuctionId; } | ||
|
|
||
| public void clearSession() { | ||
| this.sessionToken = null; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.