creativecommons / creativecommons/search

[Feature] Add option for selected card to be displayed from localStorage

Open
#99 6 comments 0 reactions 0 assignees View on GitHub
✨ goal: improvement 💻 aspect: code 🚧 status: blocked 🟩 priority: low
Dominant language
CSS
Stars
27
Forks
112
PR merge metrics
No merged PRs in 30d

Description

## Problem

From the current system, the search engine cards can be selected either randomly, or when a card is clicked.

In the usecase of returning users who always prefer a particular search engine for example, this means they always have to click on that card everytime they open the platform (unless it is hopefully randomly selected).

## Description

A third option could be set, where the last selected card should still be loaded when the user returns to the platform. That way, they can only enter the text and search unless they decide to choose another search engine. That means:

- First time users, should have a randomly selected engine
- Users can choose an engine
- Returning users will have the last selected engine by default and then they can choose another engine

## Alternatives

An option would be to use [localStorage](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage) to store the engine when clicked on the client side.

So that on page load we would check if any engine is available in localStorage: if yes, we move on to use it. If no, we randomly choose an engine.

## Implementation

- [x] I would be interested in implementing this feature.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.