-
Notifications
You must be signed in to change notification settings - Fork 590
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[bbryant824]iP #642
Open
bbryant824
wants to merge
70
commits into
nus-cs2103-AY2425S1:master
Choose a base branch
from
bbryant824:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
[bbryant824]iP #642
Conversation
This file contains 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
In build.gradle, the dependencies on distZip and/or distTar causes the shadowJar task to generate a second JAR file for which the mainClass.set("seedu.duke.Duke") does not take effect. Hence, this additional JAR file cannot be run. For this product, there is no need to generate a second JAR file to begin with. Let's remove this dependency from the build.gradle to prevent the shadowJar task from generating the extra JAR file.
level-8 p2, more oop
Add gradle support
A-Varargs with UI and javadocs added
Body: Previously, the JAR file created did not include JavaFX dependencies, causing the application to fail on systems without JavaFX installed. This commit configures the Gradle build to generate a fat JAR file, bundling the necessary JavaFX libraries within it. This ensures that the application can run on any system, regardless of whether JavaFX is installed.
Body: The TaskList#addTask method previously accepted only a single task at a time, which required multiple calls to add multiple tasks. To improve usability, we refactor the method to use Java's varargs feature, allowing multiple tasks to be added in a single method call.
The Storage and AddCommand classes lack validation checks to ensure critical assumptions hold true during runtime. Currently, the Storage class does not validate the presence of tasks or check the existence of files before performing file operations. Similarly, the AddCommand class does not validate the user input sufficiently before adding tasks. To improve reliability, let's add assertions to these classes: * Ensure tasks are non-null before saving/loading * Ensure valid task descriptions are provided in AddCommand * Verify that task file exists before attempting to load it These assertions will help catch potential logic errors during the execution of the application.
- Refactored `Main` class to improve code readability by modularizing layout and UI setup. - Extracted magic numbers into constants for window dimensions and layout spacing. - Added assertions to ensure user input is non-null and not empty before processing. - Introduced helper method `addDialog()` to avoid code duplication when adding dialogs. - Improved layout structure and event handler setup. These changes enhance code quality, readability, and ensure key assumptions hold during execution.
- Refactored TaskList to use Java Streams for generating task list output.
Add assertions to Storage and AddCommand classes
refactor: Improve UI structure and add assertions in Main class
refactor: Utilize Java Streams
- Added the ability to close the application gracefully with a short delay after the 'bye' command. - Centralized dialog management in addDialog() to handle both user and chatbot messages consistently. - Applied responsive scrolling behavior to ensure the latest messages are always visible. - Refactored the welcome message display for consistency and modularity. - Ensured smoother transitions between commands and improved the UI layout for better user interaction. This refactor improves the UI interaction flow and simplifies application exit behavior.
Currently, some error messages like "index out of bounds" do not provide enough context for the user to understand what went wrong or how to fix their input. Users may be confused by these technical terms. It is important to improve the error handling to provide more descriptive and meaningful messages. This will enhance the user experience by guiding users to provide the correct input format. This change: * Adds specific error messages for each command (e.g., "mark", "delete", "tag") when invalid input is detected. * Ensures that commands such as "mark" or "delete" include helpful instructions on what is wrong with the input and how to correct it. * Uses `KobeException` for better distinction between input errors and other exceptions. * Handles empty commands and invalid task numbers with appropriate feedback. This improves usability by ensuring the user knows exactly how to fix their mistakes rather than encountering technical error messages.
The parser previously did not validate input sufficiently, leading to situations where invalid commands could cause uncaught exceptions or incorrect feedback to users. It is necessary to ensure that commands are validated properly before execution to prevent unexpected crashes or misleading errors. This update: * Adds validation for empty inputs, task numbers, and required arguments for commands such as "mark", "delete", and "tag". * Adds specific checks for "find", ensuring that users provide either a keyword or tag. * Prevents the parser from accepting malformed commands by throwing clear, descriptive error messages via `KobeException`. By adding these checks at the parser level, we reduce potential runtime errors and provide more clear instructions to users when their commands are invalid.
The AddCommand class handles tasks that require date/time inputs (e.g., deadlines and events), but previously did not provide meaningful feedback when date/time parsing failed. Improving this feedback is crucial to prevent user frustration and guiding them to input the correct format. This change: * Refactors `AddCommand` to catch `DateTimeParseException` and give users a clear message explaining the correct date/time format. * Adds additional error handling for invalid event ranges (e.g., start time after end time). * Ensures that the user receives actionable feedback if they input the wrong format or invalid task details. This refactor ensures that users know exactly what went wrong and how to fix date/time-related errors, improving usability and reducing errors.
The Todo class currently lacks proper unit tests, which leaves it vulnerable to potential bugs and issues, especially as future changes are made to the application. Unit tests are necessary to ensure that the Todo class behaves as expected and correctly handles various scenarios, such as creating new todos, displaying the correct status, and ensuring task tagging works as intended. This update: * Adds unit tests to check basic Todo creation and ensure that newly-created todos are marked as incomplete by default. * Verifies the toString() method output to ensure it accurately reflects task completion and tag information. * Adds tests to verify correct tag addition and display in Todo tasks. By adding these tests, we improve code coverage and ensure the Todo class performs as expected in different situations, improving code reliability.
The Parser class is responsible for converting user input into commands that can be executed. However, it currently lacks robust unit testing to ensure that it correctly handles various valid and invalid inputs. Adding tests for the Parser is essential to catch potential parsing errors, especially for commands like mark, delete, and tag, which require specific arguments. This update: * Adds unit tests for common commands such as `mark`, `delete`, `tag`, and `find` to ensure proper command parsing. * Tests invalid input handling (e.g., empty commands, invalid task numbers) to verify that the Parser throws `KobeException` with meaningful error messages. * Includes tests for parsing special cases such as tag commands and keyword searches, ensuring they behave as expected. These tests provide better coverage for the Parser and ensure that it functions as intended, reducing the likelihood of errors and improving the robustness of input handling.
The Kobe class lacked comprehensive Javadocs, making it harder for developers to understand its role and functionality in the chatbot application. Proper documentation is necessary to maintain code clarity and readability. This update: * Adds Javadocs to the Kobe class, including detailed descriptions for the class itself and all its methods. * Documents the getResponse method to clarify how user input is processed and how commands are executed. * Includes descriptions for the constructor and key fields (e.g., tasks, ui, and storage). These Javadocs improve the overall maintainability of the code by making it easier for future developers to understand how the Kobe class handles task management and user interaction.
The DialogBox class lacked proper Javadocs, making it difficult for developers to grasp its role in displaying user and chatbot messages in the GUI. Providing comprehensive documentation helps improve the clarity of the UI-related code. This update: * Adds Javadocs for the DialogBox class, including detailed descriptions of its purpose and methods. * Documents methods like getUserDialog() and getKobeDialog(), explaining how the dialog boxes are styled and aligned in the UI. * Provides descriptions of how images are displayed and styled in the dialog boxes. By documenting these methods and the class behavior, the DialogBox class becomes easier to maintain and extend, especially when adding new features or improving the UI.
The TaskList class previously lacked sufficient documentation, making it challenging to understand the role and behavior of task manipulation methods such as addTask, removeTask, and findTasks. This update: * Adds Javadocs to the TaskList class, providing clear descriptions for the class and its methods. * Explains the purpose of methods like addTask(), findTasks(), and findTasksByTag(), ensuring that developers can easily understand how task lists are managed. * Documents the structure of the task list and the methods for searching and modifying the list of tasks. These improvements enhance the readability and maintainability of the code, making it easier for developers to work with task-related functionalities.
Added detailed Javadoc comments for the AddCommand class to explain its purpose and functionality in adding tasks (todo, deadline, event) to the chatbot's task list. - Documented the constructor, explaining the fullCommand parameter and its role in determining the type of task to add. - Provided thorough documentation for the execute() method, detailing how it handles different task types (todo, deadline, event). - Explained the private helper methods addDeadlineTask() and addEventTask(), including how they parse and validate date formats and manage exceptions for incorrect input. - Described error handling mechanisms in the case of invalid input and how exceptions are thrown with meaningful messages for the user. This improves the clarity and maintainability of the code by making the usage, behavior, and error handling of the class more transparent for future contributors.
Enhanced the documentation for the Kobe class to provide a clear understanding of its role as the main controller for the chatbot application. - Documented the constructor, detailing how the tasks are loaded from storage and initialized. - Provided detailed explanations for the getResponse() method, describing how user input is processed and how different commands are executed. - Included an explanation of error handling for invalid input. By improving the Javadoc for this core class, it will be easier for future developers to follow the flow of the application and understand how the chatbot processes commands and interacts with the user interface.
Provided Javadoc comments for the ExitCommand class to explain its role in handling user requests to terminate the chatbot. - Documented the constructor and the execute() method, describing how the command sets the appropriate response in the Ui to exit the application. This ensures that the ExitCommand's purpose and functionality are well documented, making the code easier to understand and modify if needed.
Added comprehensive Javadoc for the FindCommand class to provide clear explanations of the class's responsibility for searching tasks by keyword or tag. - Documented the constructor, explaining the keyword parameter. - Added details for the execute() method, highlighting how the method searches for tasks based on keyword or tag and how it handles no matching tasks. Improving documentation helps ensure that future contributors understand how the find functionality works and how it interacts with other components.
The Parser class is responsible for converting user input into commands that can be executed. However, it currently lacks robust unit testing to ensure that it correctly handles various valid and invalid inputs. Adding tests for the Parser is essential to catch potential parsing errors, especially for commands like mark, delete, and tag, which require specific arguments. This update: * Adds unit tests for common commands such as `mark`, `delete`, `tag`, and `find` to ensure proper command parsing. * Tests invalid input handling (e.g., empty commands, invalid task numbers) to verify that the Parser throws `KobeException` with meaningful error messages. * Includes tests for parsing special cases such as tag commands and keyword searches, ensuring they behave as expected. These tests provide better coverage for the Parser and ensure that it functions as intended, reducing the likelihood of errors and improving the robustness of input handling.
The Todo class currently lacks proper unit tests, which leaves it vulnerable to potential bugs and issues, especially as future changes are made to the application. Unit tests are necessary to ensure that the Todo class behaves as expected and correctly handles various scenarios, such as creating new todos, displaying the correct status, and ensuring task tagging works as intended. This update: * Adds unit tests to check basic Todo creation and ensure that newly-created todos are marked as incomplete by default. * Verifies the toString() method output to ensure it accurately reflects task completion and tag information. * Adds tests to verify correct tag addition and display in Todo tasks. By adding these tests, we improve code coverage and ensure the Todo class performs as expected in different situations, improving code reliability.
Enhanced error messages for mark and unmark commands to provide users with clear and meaningful feedback. Added validation for invalid or out-of-range task numbers, ensuring proper input formats are required. Updated Parser to handle non-numeric inputs and missing task numbers with appropriate error messages.
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.
KobeBee ~
Kobee~ frees your mind from having to remember things you need to do. It's designed to be:
🚀 Getting Started with Kobe
To get started, just follow these simple steps:
🔧 Features
Bong helps you manage your tasks efficiently. Here's what's currently available and what's coming soon:
✨ Example Usage
Here's how you can add a task in Kobe:
todo Finish project report
🎁 Why Choose Kobe?
It's FREE! 💰
Designed to be fast and easy to use.
It's your perfect companion to help manage your tasks efficiently!
Give it a try and experience the magic of stress-free task management!