Skip to content

Conversation

@naglepuff
Copy link
Collaborator

Vetting Workflow

Fix #287

Models vetting details for a particular user. Right now this means being able to capture any reference materials used by a user.

This is currently implemented as a text field that is accessible from the spectrogram sidebar.
image

image As a user types in the box, a request is made (debounced every 500ms) to update the backend with the new value. This is stored in a new database table that connects a user to their reviewer materials.

@naglepuff naglepuff requested a review from BryonLewis January 9, 2026 19:19
@naglepuff naglepuff force-pushed the issue-287-vetting-details branch from c99e650 to a1400c0 Compare January 9, 2026 20:11
Copy link
Collaborator

@BryonLewis BryonLewis left a comment

Choose a reason for hiding this comment

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

Some minor changes and questions about the overall

Comment on lines +31 to +41
@pytest.mark.django_db
def test_create_vetting_details(client):
test_text = 'foo'
data = {'reference_materials': test_text}
test_user = UserFactory()
client.force_login(user=test_user)
resp = client.post(
f'/api/v1/vetting/user/{test_user.id}', data=data, content_type='application/json'
)
assert resp.status_code == 200
assert resp.json()['user_id'] == test_user.id
Copy link
Collaborator

Choose a reason for hiding this comment

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

There is a DB constraint for the text size, should we be testin that in the tests?

Copy link
Collaborator Author

@naglepuff naglepuff Jan 12, 2026

Choose a reason for hiding this comment

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

Comment on lines 677 to 705
<v-dialog
v-model="referenceDialog"
max-width="50%"
>
<template #activator="{ props }">
<v-btn
v-bind="props"
>
Add reference materials
</v-btn>
</template>
<v-card>
<v-card-title>
Reference Materials
</v-card-title>
<v-card-text>
<v-textarea
v-model="reviewerMaterials"
placeholder="Describe any reference materials used during labeling"
@update:model-value="saveReviewerMaterials"
/>
</v-card-text>
<v-card-actions>
<v-btn
@click="referenceDialog = false"
>
Close
</v-btn>
</v-card-actions>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Since it is already in a V-dialog I would probably swap this to using a submit/cancel button and have the saving of new data connected to the submit button and cancellation prevent saving the data.
Mostly because with 500ms if you are a fast typer and hit the 2000 character limit you could get an unseen error that doesn't save the data (or if you are pasting data in).
I'd suggest swapping it to that instead of debouncing and also making it so the textarea has a limit of 2000 characters and then it will have a rule show up as well as disabling the submit button.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Refactored into a separate component in 2dff11e

@naglepuff naglepuff requested a review from BryonLewis January 12, 2026 23:13
@naglepuff naglepuff force-pushed the issue-287-vetting-details branch from 8db34c7 to 821c17d Compare January 13, 2026 16:23
Copy link
Collaborator

@BryonLewis BryonLewis left a comment

Choose a reason for hiding this comment

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

I think it is missing a way to open the Reference Materials Dialog

Copy link
Collaborator

@BryonLewis BryonLewis left a comment

Choose a reason for hiding this comment

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

The length check was set to 20 instead of 2000.
Minor note about 'save'/'close' ordering. Up to you if you want to change it.

naglepuff and others added 2 commits January 13, 2026 16:08
Co-authored-by: Bryon Lewis <61746913+BryonLewis@users.noreply.github.com>
@naglepuff naglepuff requested a review from BryonLewis January 13, 2026 21:11
Copy link
Collaborator

@BryonLewis BryonLewis left a comment

Choose a reason for hiding this comment

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

👍

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.

2 participants