Icon Studio: remember the focused icon and the scroll position across tabs

Closed
#504 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
nextjs, tailwindcss, typescript
Domain
frontend

Research direction

Start in components/icons/icon-workspace.tsx to see how the Library tab is shown and hidden, then read components/icons/icon-grid.tsx, hooks/use-windowed-grid.ts and store/icon-store.ts to find where scroll and focus state live. Choose between keeping the tab mounted or storing scroll and focus index, and note the memory cost in the PR. Done when an end-to-end test scrolls a long list, switches tabs and back, and finds the same icon focused, with no extra network requests.

Written by the indexing model from the issue text.

Description

area: ui difficulty: medium enhancement help wanted v2.0.0

Summary

Switching from the Library tab to Favicon or Export and back puts the person at the top of the results with no icon focused. Keep the scroll position and the focused icon, so exploring a large result list is not lost by a quick look at another tab.

Part of the 2.0.0 plan: fewer, better and fully tested studios, on a calmer and faster site.

Where to look

  • components/icons/icon-workspace.tsx and icon-grid.tsx
  • hooks/use-windowed-grid.ts
  • store/icon-store.ts

Behaviour

  • Keep the Library tab mounted (hidden) or store its scroll and focus index, whichever costs less memory.
  • Restore the focused icon and bring it into view when the tab is shown again.
  • Reset both when the search or the collection changes.

Acceptance criteria

  • An end-to-end test scrolls a long result list, changes tab and back, and finds the same icon focused.
  • No extra network requests are made on return.
  • The memory cost is described in the pull request.

Getting started: fork the repo, then pnpm install and pnpm dev (Node 22+, pnpm 11, no API keys). Before opening a PR, run pnpm typecheck && pnpm test && pnpm lint && pnpm format:check && pnpm check:dashes && pnpm build (CI fails on unformatted files, so pnpm format first). See CONTRIBUTING.md and the first contribution walkthrough.

Everything needed is in the repository. This doesn't need maintainer access, secrets or paid services. Comment below to claim it, and ask questions here any time.

Dominant language
TypeScript
Stars
11
Forks
3
Avg merge
5h 20m
Merged PRs (30d)
72

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from yakew7/DesignHub

All issues in yakew7/DesignHub

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.