DEV Community

Cover image for GSoC Week 3
Chiemezuo
Chiemezuo

Posted on

GSoC Week 3

One of my mentors had just returned from his presentation at DjangoCon Europe, and the other was preparing for his presentation on Wagtail Space in the Netherlands. We couldn't have our weekly virtual check-in meeting, but we synced on Slack. Thankfully, when I wrote my timeline in my GSoC proposal, I accounted for this and set this as a week with minimal mentors' involvement.

Weekly Check-in

As mentioned earlier, there wasn't a virtual meeting, but we caught up via Slack. We discussed my progress on the previous task, and I highlighted one of the approaches I experimented with for the part of the GSoC project that's for setting a mandatory image_description field to the AbstractImage model. We also discussed the necessary preps for presenting the issue to the Accessibility team. Aside from that, there wasn't so much work to do for the week, and I got some time to do some internal reflection on my progress so far.

RFC Feedback

I got some more feedback on the RFC from the more senior members of the Wagtail community. Some of the feedback was the promise to look into the RFC in more depth. Some were about possible pull requests that would help smartly reduce the amount of code I would need to have in place to get my alt text project goal working. There was also a mention of possibly resurfacing another PR that might directly or indirectly help me with my project progress. My mentors and I agreed that we'd talk more on the feedback in the following week when they were back and rested from their commitments.

Accessibility Team Meeting

In the meeting, the team discussed the progress made by one of the team members on the Wagtail Accessibility checker's alt text validation. We discussed different hypothetical scenarios on when certain things such as complete URLs would probably be acceptable to include in the alt text, and on removing the file extension suffixes and possible prefixes. We all gave ideas and suggestions on stuff that could be done to make it better.

Afterward, I reported my findings on the existing problem with making the image_description field mandatory in the AbstractImage model. I presented the three options we had so far:

  1. Making them mandatory and essentially forcing users to unlearn the existing pattern they might have been used to.
  2. Making the image_description field mandatory only when an uploaded image is to be edited, and not during the upload process.
  3. Making the field completely optional, thus defeating our purpose.

In the meeting, the Accessibility team decided that something between options 2 and 3 would suffice. We agreed on setting the field to be optional, but showing a noticeable (and annoying) red warning message during uploads and edits that the field would be necessary. This way, users would tilt towards filling the form field (because nobody likes big red warning signs), and in the event that the editor somehow missed the warning sign (possibly out of habit), everything would still behave in the initially intended way. It was a fair compromise, and it was one that allowed for iterative fixes much later on. The meeting was on a Friday afternoon, just before the weekend, but I worked on it during the weekend so I could have a demo to show my lead mentor.

Saptak was present for the accessibility meeting while Storm was away because of Wagtail Space. I have probably mentioned this a number of times in past articles, but there's something about the presence of your mentors in any meeting that gives a big boost.

I particularly liked the meeting because it was the longest I'd spoken, and I felt so at ease. I went from just watching and introducing myself at Accessibility team meetings to actively contributing to the discourse and giving my two cents on topics. Growth is something that we might never really appreciate as human beings unless we take a moment to look back at how we started.

Challenges

Being a week with minimal mentor involvement, it was not one without challenges. For the Accessibility team's feedback, there was a hitch: Getting it to work the "right" way either involved modifying templates and styles, or writing some 'strange' logic. Strange, because it would be a weird pattern. Essentially, I would have to raise a validation error on the image_description field when the form is initialized, but I would have to remove that error during validation, just before the form is to be saved. This way, the warning would always show, but would never actually get in the way of the form being saved. I tried different approaches to get it to work, hoping that I would strike some gold and get something that didn't feel so strange. It was a lot of hours of not getting any luck with approaches until I decided to go ahead with the method that felt strange. The good news, however, is that it's something that can be improved upon in the future, as well as when the PR is ready for review by the core team.

Building upon the "strange" approach, I put a conditional statement to disable the form when it was populated with data. This last part was about the easiest thing I did this week.

What I learned

With a bit of extra time on my hands, I inspected the Wagtail-generated database with the SQLite browser to see how Wagtail handled data at its most basic. I was quite impressed to see that it looked just like any other relational table, but was structured so cleanly. Pages had their own tables with different entries under them, and every page had a page pointer ID that was represented on another table. I still plan to keep exploring more of the database, but I got a big eye-opener this week. At the end of the day, every piece of software follows fundamental principles.

I also got a wee bit better at manipulating Django forms in my quest to set a constant warning in the image upload/edit forms.

Finally, because the PR for the image_description field was months old (the time of my application for GSoC), I learned how to sync its current state without burying my commits deep inside. I learned to rebase and push its commit head forward. Truly fascinating stuff.

I had another great week, and I'm excited about the amazing things I have the privilege of working on!

Cheers. ๐Ÿฅ‚

Top comments (0)