-
Notifications
You must be signed in to change notification settings - Fork 6
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
Use mudder to rank form elements and related pub values #996
Conversation
44bac3f
to
eaf5f37
Compare
eaf5f37
to
68406d1
Compare
* chore: set log level=debug * chore: try removing healthcheck * chore: add healthcheck back * chore: attach false maybe * chore: really not sure * chore: try removing minio-init * chore: empty test commit
you are a hero |
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.
looks good and works well! i made a few suggestions on improving keyboard accessibility and styles, which i think would be good to get in, and a very minor one about code organization which is not necssary. i don't think i tested every possible permutation, but it seems very stable, great work!
@@ -63,22 +67,24 @@ export const FormElement = ({ element, index, isEditing, isDisabled }: FormEleme | |||
removeElement(index); | |||
}} | |||
> | |||
<Trash size={24} className="text-neutral-400 hover:text-red-500" /> | |||
<Trash size={24} className="!pointer-events-auto text-neutral-400 hover:text-red-500" /> |
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.
hmm, no, i just applied the latest updates from shadcn there, not sure why they chose to do that.
but you could solve this problem slightly differently, by adding [&_svg]:hover:text-red-500
to the button above. this is slightly nicer i think, as the trash icon turns red if you hover the button, not just the icon
imagine the tip of this arrow being the tip of the hand pointer (can't capture my mouse grrr)
disabled={isDisabled || element.deleted} | ||
variant="ghost" | ||
className="invisible p-2 group-hover:visible" | ||
className="invisible p-2 group-hover:visible group-focus:visible" |
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.
you could fix it by giving things explicit tabIndices, using opacity instead of visibility, and using focus within.
some of these might be redundant, but ill leave comments which should give a setup like so
Screen.Recording.2025-03-05.at.13.33.14.mov
disabled={isDisabled || element.deleted} | ||
variant="ghost" | ||
className="invisible p-2 group-hover:visible" | ||
className="invisible p-2 group-hover:visible group-focus:visible" |
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.
so great you made keyboard accessibility work!
it is a bit... strange, it seems that after reordering the tabindex does not per se change (which is understandable, i think?). ends being a strange experience reordering a bunch of items
Screen.Recording.2025-03-05.at.13.20.23.mov
name: string, | ||
slug: string, | ||
communityId: CommunitiesId, | ||
isDefault: boolean, | ||
trx = db | ||
) => { | ||
const ranks = mudder.base62.mudder(pubType.fields.length + 1); |
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.
hahaha wow that would be kind of sick.
i think for inserts this is no problem at all
Co-authored-by: Thomas F. K. Jorna <[email protected]>
Ok this is finally fixed up. There were some more complications with the form builder keyboard accessibility (that were affecting tests) and I also realized it was possible to do the pub value sorting entirely in the database, so I fixed that. I also had to fix the |
Issue(s) Resolved
#963
High-level Explanation of PR
This PR:
form_elements.label
for every element on form creation or when a new element is added to a form. This shouldn't change what gets rendered in the form itself because we also check theform_elements.label
at that point, but this change means the default label will be populated in the element config form on the form builder.relationBlock
when creating a relationship element during initial form creation and when adding a new relationship form element to a form. Previously we were only setting that once the form element was edited.tab
to focus an element, then press space to pick it up. Move it up and down with the arrow keys and press space to drop.x
because the cancel button removes the element.My next PR will remove the order column from form_elements, and add the same dragging/reranking functionality to the pub_values inputs on form fill pages
Test Plan