-
Notifications
You must be signed in to change notification settings - Fork 14
Collect feedback from screener users on the accuracy of AI label #6203
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
Open
embarnard
wants to merge
4
commits into
main
Choose a base branch
from
GYR1-873-collect-feedback-from-screener-users-on-the-accuracy-of-ai-label
base: main
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
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| export default function feedback() { | ||
| document.querySelectorAll('[data-feedback-x]').forEach(button => { | ||
| button.addEventListener('click', () => { | ||
| const notesDiv = document.querySelector('[data-feedback-notes]') | ||
| notesDiv.classList.remove('hidden') | ||
| }) | ||
| }) | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,10 @@ | ||
| // See `app/javascript/hub/README.md` | ||
| import MainMenuComponent from "../hub/MainMenuComponent"; | ||
| import imageRotate from "../hub/image_rotate"; | ||
| import feedback from "../hub/feedback"; | ||
|
|
||
| window.addEventListener("load", function() { | ||
| MainMenuComponent(); | ||
| imageRotate(); | ||
| feedback(); | ||
| }) |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| # == Schema Information | ||
| # | ||
| # Table name: doc_assessment_feedbacks | ||
| # | ||
| # id :bigint not null, primary key | ||
| # feedback :integer default("unfilled"), not null | ||
| # feedback_notes :text | ||
| # created_at :datetime not null | ||
| # updated_at :datetime not null | ||
| # doc_assessment_id :bigint not null | ||
| # user_id :bigint not null | ||
| # | ||
| # Indexes | ||
| # | ||
| # index_doc_assessment_feedbacks_on_doc_assessment_id (doc_assessment_id) | ||
| # index_doc_assessment_feedbacks_on_user_id (user_id) | ||
| # | ||
| # Foreign Keys | ||
| # | ||
| # fk_rails_... (doc_assessment_id => doc_assessments.id) | ||
| # fk_rails_... (user_id => users.id) | ||
| # | ||
| class DocAssessmentFeedback < ApplicationRecord | ||
| belongs_to :doc_assessment | ||
| belongs_to :user | ||
|
|
||
| enum feedback: { unfilled: 0, correct: 1, incorrect: 2 }, _prefix: :feedback | ||
|
|
||
| validates :feedback, presence: true | ||
| end |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| <% if current_user.admin? && (@document.latest_assessment.present? && @document.latest_assessment&.feedbacks.blank?) %> | ||
| <div class="feedback-box"> | ||
| <div id="top-question"> | ||
| <span>Is the Smart Scan label correct?</span> | ||
|
|
||
| <%= button_to record_feedback_hub_client_document_path, | ||
| params: { feedback: "correct" }, | ||
| style: "background:none; border:none; padding:0; cursor:pointer;" do %> | ||
| <%= image_tag('icons/checkmark-green-circle.svg', alt: "correct") %> | ||
| <% end %> | ||
|
|
||
| <button type="button" | ||
| data-feedback-x | ||
| style="background:none; border:none; padding:0; cursor:pointer;"> | ||
| <%= image_tag('icons/crossmark-red-circle.svg', alt: "incorrect") %> | ||
| </button> | ||
| </div> | ||
|
|
||
| <div data-feedback-notes class="hidden spacing-above-15 spacing-below-0"> | ||
| <p class="spacing-below-5">Provide additional feedback</p> | ||
| <%= form_with url: record_feedback_hub_client_document_path, method: :post do |f| %> | ||
| <%= f.hidden_field :feedback, value: "incorrect" %> | ||
| <%= f.text_area :feedback_notes, id: "additional-feedback" %> | ||
| <div class="spacing-above-10 spacing-below-0"> | ||
| <%= f.submit "Submit feedback", class: "button" %> | ||
| </div> | ||
| <% end %> | ||
| </div> | ||
|
|
||
| </div> | ||
| <% end %> |
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
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
13 changes: 13 additions & 0 deletions
13
db/migrate/20260223212700_create_doc_assessment_feedbacks.rb
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| class CreateDocAssessmentFeedbacks < ActiveRecord::Migration[7.1] | ||
| def change | ||
| create_table :doc_assessment_feedbacks do |t| | ||
| t.references :doc_assessment, null: false, foreign_key: true | ||
| t.references :user, null: false, foreign_key: true | ||
|
|
||
| t.integer :feedback, null: false, default: 0 | ||
| t.text :feedback_notes | ||
|
|
||
| t.timestamps | ||
| end | ||
| end | ||
| end |
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you want to add a spec under the controller spec?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point! just added one