-
Notifications
You must be signed in to change notification settings - Fork 1
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
Mock api / Throwaway Edit UI Changes #50
Conversation
@@ -118,12 +119,12 @@ const SequenceElementEdit: FormElementComponent<SequenceElement> = ({ | |||
<input type="hidden" {...register(`${element.id}.id`)} /> | |||
<input type="hidden" {...register(`${element.id}.type`)} /> | |||
<input type="hidden" {...register(`${element.id}.elements`)} /> | |||
{elements.map(elements => ( | |||
{elements.map(el => ( |
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.
I was tracking down an error and having a bunch of nested objects using the same variable name was making me slightly bananas. This doesn't strictly need to be changed
], | ||
"include": [ | ||
"./packages/*/src/**/*.json", | ||
], |
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.
Various config changes to permit importing a local .json file in an idiomatic way
This is a WIP, but don't let me block you from merging it if you're comfortable.
I built into the stub of the fakeCache function Document's suggestFormDetails(). There's a small hard-coded fieldsMap object I was using for testing and a parseJson() function in mock-api.ts that can produce a complete fieldsMap object from a json object (currently being read in from a file).
The primary remaining work is to continue refining the relationship between parsedPDF and the fieldsMap object.
The biggest tension is figuring out groups of elements. The quality of what the parsing routine is able to deliver jumps quite a bit once we're able to accommodate element groups that look like:
For reasons that are hard to explain succinctly, but easy to see in practice, treating all of those objects as independent elements creates lots of friction and extra work for the content author.
The next biggest tension is forcing users to treat every line of non-input text parsed from the pdf as a independent editable object, rather than lumping them together. Google forms has a very opinionated take that privileges architecture simplicity over flexible UX, it's worth looking at for early iterations of our editing UI. We can probably leapfrog a lot of time coming around to the same conclusions.
I tweaked some things in the edit UI mostly for my own education/edification, hopefully those changes will be washed away soon by new incoming designs.
TODO: I barely touched the display side at all. The non-input paragraph element needs an appropriate representation. I noticed the paragraphBlock object in the unwired fieldset comments, but I didn't dig into it. The only change I made was to substitute the label over the input fields with
element.instructions
because we have instructions now and it seemed more appropriate thanelement.name
.TODO: Make sure the createPrompt() in the paragraph element definition is sensible. I don't totally understand its purpose and implications.
TODO: I'm not sure the paragraph element is appropriately named or actually wants to be tied to a paragraph html tag. Realistically, it's probably going to be hard to avoid a div level container of multiple text tags, unless we get much better at parsing and auto-combining elements. Even then, we'll have to see how much users are willing to put up with in terms of forcing them to edit closely-related chunks of text as separate objects.