Skip to content
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

[ENH] Implemented Annotate Another Dataset button #832

Merged
merged 8 commits into from
Dec 12, 2024
Merged

[ENH] Implemented Annotate Another Dataset button #832

merged 8 commits into from
Dec 12, 2024

Conversation

rmanaem
Copy link
Contributor

@rmanaem rmanaem commented Dec 12, 2024

Checklist

This section is for the PR reviewer

  • PR has an interpretable title with a prefix ([ENH], [FIX], [REF], [TST], [CI], [MNT], [INF], [MODEL], [DOC]) (see our Contributing Guidelines for more info)
  • PR links to GitHub issue with mention Closes #XXXX
  • Tests pass
  • Checks pass

For new features:

  • Tests have been added

For bug fixes:

  • There is at least one test that would fail under the original bug conditions.

Copy link

sourcery-ai bot commented Dec 12, 2024

Reviewer's Guide by Sourcery

This PR implements a new feature to allow users to annotate another dataset by adding a reset functionality and improves the search filtering in dropdown selectors. The changes include adding a new button on the download page, implementing a state reset mechanism, and enhancing the filtering logic for v-select components.

Sequence Diagram for State Reset and Navigation

sequenceDiagram
    actor User
    participant DownloadPage
    participant Store
    participant HomePage

    User->>DownloadPage: Click 'Annotate Another Dataset'
    DownloadPage->>Store: Call resetState()
    Store-->>DownloadPage: State reset
    DownloadPage->>HomePage: Navigate to home page
    HomePage-->>User: Ready for new annotation
Loading

Class Diagram for State Management Changes

classDiagram
    class Store {
        +getDefaultState() State
        +resetState(p_state)
    }
    class State {
        +annotationCount: int
        +columnToToolMap: Map
        +resetState()
    }
    Store --> State
    note for Store "Store now uses getDefaultState for initialization and resetState for resetting state."
Loading

File-Level Changes

Change Details Files
Added state reset functionality to allow annotating multiple datasets
  • Extracted default state into a separate function
  • Added resetState mutation to restore store to initial state
  • Implemented 'Annotate Another Dataset' button with reset and navigation logic
store/index.js
pages/download.vue
Enhanced dropdown search functionality with improved filtering
  • Added filterOptions method to improve search matching
  • Implemented character-by-character matching algorithm
  • Applied filter to tool selection and categorical value dropdowns
components/category-toolgroup.vue
components/annot-categorical.vue
Removed integer type from transform options
  • Removed 'int' type from transform options
  • Updated related test files to reflect the removal
store/index.js
cypress/unit/store-getter-getTransformOptions.cy.js
cypress/unit/store-getter-getContinousJsonOutput.cy.js

Assessment against linked issues

Issue Objective Addressed Explanation
#816 Add functionality to refresh/reset the application state after completing an annotation

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time. You can also use
    this command to specify where the summary should be inserted.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

netlify bot commented Dec 12, 2024

Deploy Preview for neurobagel-annotator ready!

Name Link
🔨 Latest commit 367ae22
🔍 Latest deploy log https://app.netlify.com/sites/neurobagel-annotator/deploys/675b6111c3b42c0008aac767
😎 Deploy Preview https://deploy-preview-832--neurobagel-annotator.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @rmanaem - I've reviewed your changes - here's some feedback:

Overall Comments:

  • Please fill out the 'Changes proposed' section in the PR description, including details about the new Annotate Another Dataset button, dropdown filtering improvements, and rationale for removing integer type support.
Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@surchs surchs self-requested a review December 12, 2024 21:10
Copy link
Contributor

@surchs surchs left a comment

Choose a reason for hiding this comment

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

One suggestion, otherwise 🧑‍🍳

sidenote: The diff on these chained PRs is a bit tricky to read. It works because they are short, but even happier would be either:

  • last PR merges into previous branch it chained off of (assuming that is not merged yet)
  • every PR is branched off (and targeting) main directly.

store/index.js Outdated Show resolved Hide resolved
store/index.js Show resolved Hide resolved
@rmanaem rmanaem merged commit b578fd7 into main Dec 12, 2024
9 checks passed
@rmanaem rmanaem deleted the enh-816 branch December 12, 2024 22:23
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.

Add "Annotate another dataset" button on the download page that refreshes the app
2 participants