logo

Improving the user experience of filtering functionality

Topics: UI/UXDesignFront-end DevelopmentCSSJavaScript

No one likes an interface that is difficult to use. Sure, there’s going to be a lot of subjectivity behind the idea of the right design, but when the overall consensus is that something isn’t working, we should aim to improve it. After all, the goal of every website should be to help their visitors find what they’re looking for as effectively as possible and anything that stands in the way of that should be scrutinized in an effort to make it better.

Originally, GoBeyond Travel had a sidebar-style design for the filtering functionality on their programs page. I believe the intent here was to approach it in a similar style to an e-commerce site, where you could immediately filter by criteria such as the country visited, what types of activities are focused on, and the trip date range.

original desktop design for the GoBeyond Travel programs page
The original desktop design for the programs page filtering functionality

However, as the amount of filterable options grew, the usability of the filtering system began to show cracks. The following items were the most apparent pain points:

original mobile design for the GoBeyond Travel programs page filters
The original mobile design for the programs page filters

The Redesign

Keeping in mind the issues mentioned above, I set out for a redesign of the programs page filtering functionality. It’s not often that I have the opportunity to step into design, but this was one of those instances where I could.

My initial thought was that a horizontal drop-down menu would be the best way to fix the issues with the current functionality. I thought that the color palette, typography, and iconography from the original design worked well, so I made an effort to keep as much of that as possible. After finishing the design mockups, the client agreed with my approach and development started on the new version of the filtering functionality.

initial desktop re-design for the GoBeyond Travel programs page filters
What visitors now initially see when loading the programs page

Much better! The filters are now tucked away nicely and easily accessible when needed, appearing when hovering over the corresponding menu item. Additionally, with the reclaimed space in the content area it’s now possible to display three cards per row without them feeling smashed together.

Reclaiming space in the layout by using a dropdown menu
Space in the page layout was reclaimed by utilizing a dropdown menu for filter options that becomes visible as you hover over it.
Small touches like dynamic text can help improve UX
Small touches can make a big difference in UX. For example, the active filters are displayed dynamically in the menu item sub-text.

Alright, so the desktop design is far more usable now, but what about mobile? Previously, the vertical filters layout was also used on tablets, which led to both the filters and the content feel like they were fighting each other for space. As part of the updates, the tablet layout was changed so that it functioned the same as the mobile layout, with a clear way to active the filters. Again, this reclaimed space, making it possible to showcase an additional card in the tablet layout.

To overcome the issues with the original mobile filter design, the menu was updated to use a modal approach to prevent content overflow issues and a fixed close button was placed in the upper right corner so that users always have a clear way out of the filters.

Tablet and mobile redesign of the programs page filters
The tablet design now utilizes the same modal menu that the mobile version uses and displays an additional card with the reclaimed space. The menu modal now has a consistently visible close button and no more content overflow issues.

But wait, there’s more!

While working on the filtering functionality redesign, it was also decided to give the program cards a slight overhaul. There were two main issues that needed to be resolved:

To remedy these issues, the top ranking component from the Focus, Adventure, and Environment filter categories was set to display by default on each card, with additional filters being displayed as they are selected. The session dates section was given a contrasting color scheme in line with the overall color scheme of the site to help with visibility.

These changes helped the program cards display more information in a clearer way without seeming too cluttered or overwhelming. Additionally, the hover state of the cards was also updated with a slight layout shift and a “View Details” button appearing at the bottom of the card.

New design for the GoBeyond Travel programs cards
The new program card design features the top three progress bars shown by default, a contrasting session dates section, and an updated hover state.

The technical side of the redesign

Over the years, several different developers have worked on this site. Unfortunately, that has also led to several different approaches to development. When I find myself in situations like this, my main goal is to isolate my updates as much as possible.

My approach to JavaScript needed for this functionality was to encapsulate all of my code within its own class and then load and instantiate that class dynamically depending on if it’s needed for the current page. Here’s some pseudo-code to better show what I mean:

// An example of the class encapsulating the filtering logic

class JourneysArchiveTemplate {
	constructor(parentEl) {
		// the parent element is passed into the instance so that child elements can be accessed, events bound, etc...
		this.parentEl = parentEl;
		this.menuEl = this.parentEl.querySelector('.filter-menu-selector');

		// initialize some values to store the state
		this.activeFilters = {
			activities: [],
			countries: [],
			dateStart: null,
			dateEnd: null
		};

		// initializing logic and adding events is handled by class methods
		this.initHoverEvents();
		this.initMobileMenu();

		// etc...
	}
}
// and in the core JS that is always executed...

const parentEl = document.querySelector('.archive-template-classname');

if (parentEl) {
	import('./path/to/encapsulating-class.js')
		.then(({ default: JourneysArchiveTemplate }) => {
			const journeysArchiveInstance = new JourneysArchiveTemplate(parentEl);
		})
		.catch((err)) => {
			// handle any errors that occur while dynamically importing the class
		}
}

There are different ways of approaching the concept of encapsulation, but this method made the most sense for the project. If the filtering logic had been more complicated or if I anticipated that it would be growing significantly in the future, I would have used React (or more likely Preact in this case since the usage would be rather basic) to simplify managing state within the DOM. If the functionality had a need to be repurposed for use elsewhere on this site or in another project, I would have implemented it as a Web Component.

My approach to styling followed a similar route in terms of isolation. I made of use of the BEM methodology, as I do in most of my work. Since it is only a naming convention and not a framework that requires additional tooling, I’ve found it fits well into projects like this where the rest of the styling doesn’t necessarily follow any strict conventions.

Final thoughts

I enjoyed this project a bit more than some of the other work I do since I was able to focus on the UX and use my (admittedly limited) design skills. A large part of my development philosophy is maintaining an perspective of the user experience, especially that of new users and what their initial impressions could be. It can be difficult to keep that frame of mind fresh, especially when you’ve been immersed in the technical side of a project, but tackling challenges that are focused on UX has always been rewarding for me as it helps to maintain that important user perspective.

Return to work page