Skip to content

feat(history): add prev/next year buttons#164

Merged
MarshallOfSound merged 5 commits intomainfrom
feat/prev-next-year-buttons
Sep 2, 2025
Merged

feat(history): add prev/next year buttons#164
MarshallOfSound merged 5 commits intomainfrom
feat/prev-next-year-buttons

Conversation

@erickzhao
Copy link
Member

One fewer click to go between consecutive years in the /history view.

Screen.Recording.2025-05-02.at.10.16.04.mov

@erickzhao erickzhao requested review from a team as code owners May 2, 2025 17:17
@MarshallOfSound MarshallOfSound temporarily deployed to release-stat-feat-prev--ftu25l May 2, 2025 17:18 Inactive
Copy link
Member

@MarshallOfSound MarshallOfSound left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make these themed as buttons not links and I don't love it being pushed onto a new line, vertical space is precious.

image

E.g. something like that?

@MarshallOfSound MarshallOfSound temporarily deployed to release-stat-feat-prev--ftu25l May 2, 2025 21:13 Inactive
@erickzhao erickzhao force-pushed the feat/prev-next-year-buttons branch from 1c19c74 to e41974f Compare May 2, 2025 21:15
@MarshallOfSound MarshallOfSound temporarily deployed to release-stat-feat-prev--ftu25l May 2, 2025 21:15 Inactive
@erickzhao
Copy link
Member Author

e41974f switches the implementation to add buttons on either side of the Select and keeps it on the top right of the page.

image

@erickzhao erickzhao requested a review from MarshallOfSound May 2, 2025 21:16
<button
className="bg-white dark:bg-gray-800 hover:enabled:bg-gray-100 dark:hover:enabled:bg-gray-700 rounded-lg shadow-sm outline outline-1 outline-gray-200 dark:outline-gray-700 p-1 flex items-center gap-2 disabled:text-gray-400 disabled:cursor-not-allowed transition-colors"
disabled={year >= new Date().getFullYear()}
onClick={() => setYear(`${year + 1}`)}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

useCallback ify this please

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<div className="flex gap-2">
<button
className="bg-white dark:bg-gray-800 hover:enabled:bg-gray-100 dark:hover:enabled:bg-gray-700 rounded-lg shadow-sm outline outline-1 outline-gray-200 dark:outline-gray-700 p-1 flex items-center gap-2 disabled:text-gray-400 disabled:cursor-not-allowed transition-colors"
onClick={() => setYear(`${year - 1}`)}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

useCallback ify this please

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

erickzhao and others added 2 commits May 5, 2025 10:17
Co-authored-by: Samuel Attard <sam@electronjs.org>
@erickzhao erickzhao requested a review from MarshallOfSound May 5, 2025 17:30
@MarshallOfSound MarshallOfSound temporarily deployed to release-stat-feat-prev--yeorxa May 5, 2025 17:31 Inactive
@MarshallOfSound MarshallOfSound temporarily deployed to release-stat-feat-prev--d0bm4k September 2, 2025 18:39 Inactive
@MarshallOfSound MarshallOfSound merged commit de374e7 into main Sep 2, 2025
4 checks passed
@MarshallOfSound MarshallOfSound deleted the feat/prev-next-year-buttons branch September 2, 2025 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants