Skip to main content

Hacktoberfest - Pull request 4 - Fixing a UI Bug in "Lifestyle-Ecommerce-Website"

We are nearing the end of Hacktoberfest and that means we are finishing the challenge with our fourth and final pull request. In my previous post, I announced and explained my third pull request for this year's Hacktoberfest event, where I enhanced the UI/UX of Rhymus, a web based word-puzzle game designed to improve a users vocabulary. I also went on to say that my goal for this pull request will be to solve an actual bug within the code of a project, meaning  correcting an actual flaw, rather than enhancements and additions which I had done so far.

I am proud to say I did exactly what I aimed to by fixing a bug in a project called "Lifestyle-Ecommerce-Website".

The Project: Lifestyle-Ecommerce-Website

Lifestyle-Ecommerce-Website is a front-end project for building an online store. It supplies various well designed pages for front-end developers to customize and utilize as a starting point for their e-commerce projects, whether it be for themselves or their clients. I gravitated towards this project because I've do some freelance web development on an occasional basis, and often utilize pre-designed themes like this project to speed up the process. I thought it would be fitting for me to give back to the type of work I've used in the past.

The project is built with a standard web development stack of  HTML5, CSS, and Javascript. It  makes use of many stylesheet libraries including Bootstrap, Scaffold, and it's own custom style-sheet developed by the creator of this project, and after a lot investigation, this ended up being the root of the issue ended up being.

The Issue: Mis-aligned components throughout the site

Whenever the project displays a collection of items, the alignment of the borders, buttons and titles seemed to be off at multiple places. My first guess was that this was due to varying item name lengths, image dimensions, or other unpredictable aspects of the dynamically generated content.

After an hour or two of investigation that featured chromes dev tools to disable/enable various styling properties from the various stylesheets that were used in the project, I finally found the issue.



Example of the Issue. Final "Add to Cart" Button not aligned with the rest of the row


The Fix & Pull Request

Screenshot of fixed output. All UI components are uniformly aligned. 


My first guess was half-correct. The issue was in regards to constraints on the item thumbnail images used. Varying heights on different pictures would cause the alignment to look different than other pictures.  My assumption was that there was an absence of constraints, however it turned out that there were styling conflicts between the various stylesheet libraries used that were overriding the constraints.

I went ahead and assigned a "thumbnail" class name to all the div tags generated for items, and then targeted the img tags inside those thumbnail div tags from the styles.css stylesheet which will override all the other styling conflicts for those items. From there, I put a constraint property that would cap the height at 150 pixels (max-height: 150px).

The fix itself was only about 5 lines of code, however the investigation to find the source of the problem is what consumed a significant amount of time.

Next Steps From Here

Looking back at my pull requests throughout Hacktoberfest, there is a clear progression in my contributions to open-source. I started with documentation, then content addition, then styling additions/enhancements, and then finally an actual bug fix. I hope to continue this trend as I advance in my open-source journey.

After successfully completing Hacktoberfest and achieving all the goals I set for each PR, the next step would be to tackle some larger scale issues for bigger projects.





Comments

Popular posts from this blog

Release 0.4 - My External Pull Request to Uber

Continuing from my previous post , I will now be covering my external contribution for Release 0.4. This external pull request is my biggest and most challenging one to date. The challenge came from size of the project, as searching and navigating through it's code base felt like somewhat of a rats maze to find where the issue lies. I also had minimal experience in React (one small school project), so the unfamiliarity with the language and architecture presented some challenges as well. The Project -  Uber - Base Web In short, Base Web is Uber's web based design system comprised of "modern, responsive, living components" implemented in ReactJS. This project contains a vast variety of functional web components that can be used by web developers the front-end of their web projects. As someone who has done freelance web development in the past, I've always appreciated the availability of open source libraries, especially the more complex one's such as this ...

Lab 8 - Contribution Goals for CDOT Telescope & LifeStyle E-Commerce

After successfully completing Hacktoberfest, we move onto bigger and better challenges in open source. By November 15th I have the following goals to complete: 1. Contribute to a bigger issue on an open-source project (no more "good-first-issue" tags). 2. Contribute to CDOT Telescope, an internal project built by my fellow classmates. In this post I will break down my issue and goal for each goal. External Project- LifeStyle E-Commerce  This is a project I found in hacktoberfest and fixed a styling alignment bug for. You can find the full details of my contribution in my previous post.   If you are already familiar wit the project, you can skip the overview section. Overview Lifestyle E-ommerce is a front-end project for building an online store. It supplies various well designed pages for front-end developers to customize and utilize as a starting point for their e-commerce projects, whether it be for themselves or their clients. I gravitated towards this ...

Release 0.4 - My Internal Pull Request to Telescope

After a frantic 12 weeks, we have arrived at Release 0.4 - AKA the final release for the DPS909 Open-source course. Much like the previous release I covered, this release is comprised of two parts: an internal pull request to CDOT Telescope, and a more challenging external pull request to an open-source project. To improve your reading experience, I've also split my blog up into two parts. This post will be covering my internal contribution to CDOT Telescope. For a full description on what Telescope is, please refer to my previous pos t where I introduced it in detail, or the official overview . The Issue -  Search icon floating with window resize  Demonstration of the floating search issue Another student had added a dynamically floating search bar to the front end, however it was not functioning correctly as it would sporadically float around as you scroll or resize the page.  The initial hypothesis was that it was positioned relative to the view port cs...