PROJECT: ɯeme


Overview

ɯeme is a meme manager app for those who prefer to use a desktop app for managing memes. More importantly, ɯeme is optimized for those who prefer to work with a Command Line Interface (CLI) while still having the benefits of a Graphical User Interface (GUI). Users can view, tag, search, import and export a collection of meme. They can also create their own memes from meme templates.

Summary of contributions

  • Major enhancement: added the ability to suggest and auto-complete commands

    • What it does: allows the user to type command faster and more easily by showing possible command arguments and allow the user to use TAB key to auto-complete the command.

    • Justification: This feature improves the product significantly because a user can be tired of typing the full command over and over again, or unsure of what arguments to supply.

    • Highlights: This enhancement affects existing commands and commands to be added in future. It required an in-depth analysis of design alternatives. The implementation too was challenging as it requires live update of input and different methods to process different commands in order to generate suggestions.

    • Credits: LevenshteinDistance in org.apache.commons.text is used in calculating the similarity between strings.

  • Minor enhancement:

    • Refactored commands and parser packages by grouping files into sub-packages according to the type of commands. [#114]

  • Code contributed: [RepoSense Data]

  • Other contributions:

    • Update AboutUs, ContactUs and README [#32]

    • Reported bugs and suggestions for other teams [PED]

Contributions to the User Guide

Given below are sections I contributed to the User Guide. They showcase my ability to write documentation targeting end-users.

Command Suggestions

  • Suggestions for command word/argument based on current user input will be displayed in the result box.

  • The auto-suggestion is dynamic and automatically updates while the user type in command.

  • The suggestions are retrieved from historical records and sorted according to the similarity to user input, with the first suggestion being the most recommended one.

  • For the command word suggestion, only commands available for current context will be displayed. Description for each command will be displayed after each command word.

  • User can press Tab key to auto-complete the command suggestion, i.e. replacing current command word/arguments with the first suggestion displayed (if there is any).

  • If the user input is of invalid format, the text will turn red and error messages will be displayed in the result box immediately without pressing Enter key. This does not account for invalid values, e.g. input meme index is 5 but there is no meme of index 5.

Example 1:
When user types in a in the meme context, the following suggestions will appear:
add: adds a meme to Weme.
archive: archive a meme by index.
archives: list all archived memes.

If Tab is pressed, a in the command box will be replaced by add.

Example 2:
When user types in add p/pathToMeme t/c, the following suggestions will appear:
CS
cute
CS2103

If Tab is pressed, c in the command box will be replaced by CS.

Contributions to the Developer Guide

Given below are sections I contributed to the Developer Guide. They showcase my ability to write technical documentation and the technical depth of my contributions to the project.

Command Suggestion Feature

Users can be forgetful about the command format and sometimes unsure of what arguments to supply. Auto-suggestion of command arguments while the user keys in inputs can be very helpful to provide user hints. Possible command words will be suggested to user based on incomplete input. Depending on what the user has typed in for the argument, the most similar argument values retrieved from the historical records will be displayed to the user for reference. The user can also use the "TAB" key to auto complete the command word/argument, where the first prompt will replace the current command word/argument in user input.

Current Implementation

The command suggestion is achieved using a package of prompter files. For each parser, there will a corresponding prompter to process the current user input and return the CommandPrompt for display in ResultBox. The following class diagram summarizes the Prompter package in the Logic.

CommandPromptClassDiagram
Figure 1. Partial Class Diagram of the Logic Component related Prompter package

The following Sequence Diagram summarizes the how a CommandPrompt is generated:

CommandPromptSequenceDiagram

Here is how a user interact with the command suggestion features:

Step 1. The user types commands into the CommandBox.

Step 2. The MainWindow listens to changes in the content in CommandBox and direct the input to WemePrompter.

Step 3. Depending on the context, the prompter that implements WemePrompter (e.g. MemePrompter) will then pass the arguments

to different Prompter (e.g. MemeAddCommandPrompter) based on the command word.

Step 4. The Prompter will process the input and return a CommandPrompt containing the command suggestion, and the

complete text for auto-completion for the given input.

Step 5. The prompt will be passed to and displayed by ResultBox.

Step 6. The CommandBox listens to the "TAB" key press, and replace the current argument with the first command prompt.

The following Activity Diagram summarizes the command suggestion process:

CommandPromptActivityDiagram

Design Considerations

Aspect: How to process the input and produce the command prompt
  • Alternative 1 (current choice): Use a prompter package to abstract out the prompter for each command.

    • Pros: Single Responsibility Principle and Separation of Concerns are achieved and coupling is reduced.

    • Cons: Additional layer of abstraction and longer code.

  • Alternative 2: Add one more method in each parser.

    • Pros: Easier to implement.

    • Cons: The class that processses input will depend on Parser.

Aspect: How to store and access historical records.
  • Alternative 1 (current choice): Use a separate Records storage file to store all the historical arguments.

    • Pros: Better abstraction and the records has the option to persist even if the file is deleted.

    • Cons: More files to store and longer code.

  • Alternative 2: Store arguments of a resource (e.g. Meme) as a field of the resource.

    • Pros: Easier to implement and cleaner.

    • Cons: Irrelevant information needs to be stored as a field (e.g. original file path of a resource).