Skip to content

Refactor user roles and enhance dashboard with new features#34

Merged
bekam-bit merged 11 commits into
task/member2from
main
May 25, 2026
Merged

Refactor user roles and enhance dashboard with new features#34
bekam-bit merged 11 commits into
task/member2from
main

Conversation

@bekam-bit
Copy link
Copy Markdown
Contributor

No description provided.

bella-247 added 11 commits May 23, 2026 21:11
- 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.
feat: implement database management layer, auction service skeleton, …
Copilot AI review requested due to automatic review settings May 25, 2026 11:37
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 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 SellerDashboardUserDashboard, 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 ViewLoader resolution, 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.fxml is not valid FXML as written: the root element is VBox, but it still contains a <center> child (a BorderPane-only property). This will cause FXMLLoader to fail at runtime; restructure the layout to match the chosen root (e.g., switch back to BorderPane or remove the <center> wrapper and use standard VBox children).
<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.css to the Scene stylesheets. Since some views (e.g., user_dashboard.fxml) now also declare style.css in <stylesheets>, the stylesheet can be loaded twice, leading to redundant parsing and potential ordering surprises. Pick one approach (centralized in ViewLoader or 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())) {
Comment thread docs/table-of-contents.md
- [Bidder Dashboard](#5-bidder-dashboard)
- [Seller Dashboard](#6-seller-dashboard)
- [User Dashboard](#5-user-dashboard)
- [User Dashboard](#5-user-dashboard)
Comment thread docs/RTDAS_PRD.md
| 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 thread docs/abel.md
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;
@bekam-bit bekam-bit merged commit 90a16cf into task/member2 May 25, 2026
8 checks 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