Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add previous/next month navigation to the MonthPicker #4692

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

misu-dev
Copy link

A small change to introduce previous/next month navigation in the MonthPicker.

image

@actual-github-bot actual-github-bot bot changed the title feat: add previous/next month navigation to the MonthPicker [WIP] feat: add previous/next month navigation to the MonthPicker Mar 26, 2025
Copy link

netlify bot commented Mar 26, 2025

Deploy Preview for actualbudget ready!

Name Link
🔨 Latest commit da58a26
🔍 Latest deploy log https://app.netlify.com/sites/actualbudget/deploys/67e6e9684f6d850008d7cfd0
😎 Deploy Preview https://deploy-preview-4692.demo.actualbudget.org
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Contributor

github-actions bot commented Mar 26, 2025

Bundle Stats — desktop-client

Hey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle.

As this PR is updated, I'll keep you updated on how the bundle size is impacted.

Total

Files count Total bundle size % Changed
18 8.5 MB → 8.5 MB (+1.64 kB) +0.02%
Changeset
File Δ Size
node_modules/function-bind/index.js 📈 +189 B (+180.00%) 105 B → 294 B
src/components/budget/MonthPicker.tsx 📈 +1.14 kB (+20.64%) 5.54 kB → 6.69 kB
node_modules/function-bind/implementation.js 📈 +265 B (+12.98%) 1.99 kB → 2.25 kB
node_modules/hasown/index.js 📈 +9 B (+5.06%) 178 B → 187 B
node_modules/call-bind-apply-helpers/applyBind.js 📈 +9 B (+4.09%) 220 B → 229 B
node_modules/call-bind-apply-helpers/actualApply.js 📈 +9 B (+3.63%) 248 B → 257 B
node_modules/call-bind-apply-helpers/index.js 📈 +9 B (+2.44%) 369 B → 378 B
node_modules/object-keys/index.js 📈 +2 B (+0.25%) 794 B → 796 B
node_modules/object-keys/implementation.js 📈 +8 B (+0.23%) 3.43 kB → 3.44 kB
node_modules/get-intrinsic/index.js 📈 +9 B (+0.06%) 13.63 kB → 13.64 kB
View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

Asset File Size % Changed
static/js/index.js 5.5 MB → 5.5 MB (+1.64 kB) +0.03%

Smaller

No assets were smaller

Unchanged

Asset File Size % Changed
static/js/en-GB.js 5.37 kB 0%
static/js/es.js 65.71 kB 0%
static/js/nl.js 102.79 kB 0%
static/js/fr.js 128.02 kB 0%
static/js/en.js 110.12 kB 0%
static/js/de.js 122.37 kB 0%
static/js/workbox-window.prod.es5.js 5.69 kB 0%
static/js/indexeddb-main-thread-worker-e59fee74.js 13.5 kB 0%
static/js/resize-observer.js 18.37 kB 0%
static/js/BackgroundImage.js 122.29 kB 0%
static/js/pt-BR.js 120.98 kB 0%
static/js/uk.js 110.59 kB 0%
static/js/useAccountPreviewTransactions.js 1.69 kB 0%
static/js/AppliedFilters.js 10.87 kB 0%
static/js/wide.js 112.23 kB 0%
static/js/narrow.js 383.22 kB 0%
static/js/ReportRouter.js 1.59 MB 0%

Copy link
Contributor

github-actions bot commented Mar 26, 2025

Bundle Stats — loot-core

Hey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle.

As this PR is updated, I'll keep you updated on how the bundle size is impacted.

Total

Files count Total bundle size % Changed
1 2.28 MB 0%

Changeset

No files were changed

View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

No assets were bigger

Smaller

No assets were smaller

Unchanged

Asset File Size % Changed
kcab.worker.js 2.28 MB 0%

@misu-dev misu-dev force-pushed the feat/month-picker-navigation branch from 981d8a6 to 2a5919c Compare March 27, 2025 20:03
@misu-dev misu-dev force-pushed the feat/month-picker-navigation branch from 2a5919c to da58a26 Compare March 28, 2025 18:24
@misu-dev misu-dev changed the title [WIP] feat: add previous/next month navigation to the MonthPicker feat: add previous/next month navigation to the MonthPicker Mar 29, 2025
Copy link
Contributor

coderabbitai bot commented Mar 29, 2025

Walkthrough

This pull request enhances the MonthPicker component by adding two new navigation buttons that allow users to select the previous or next month. The buttons are implemented using the Link component. Each button triggers the onSelect function with a month calculated via monthUtils (prevMonth for the left button and nextMonth for the right button). Both buttons include directional icons and are styled with padding and margin to maintain proper spacing.

Possibly related PRs

Suggested labels

:sparkles: Merged

Suggested reviewers

  • youngcw

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 77949ad and da58a26.

⛔ Files ignored due to path filters (7)
  • packages/desktop-client/e2e/budget.test.ts-snapshots/Budget-renders-the-summary-information-available-funds-overspent-budgeted-and-for-next-month-1-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/budget.test.ts-snapshots/Budget-renders-the-summary-information-available-funds-overspent-budgeted-and-for-next-month-2-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/budget.test.ts-snapshots/Budget-renders-the-summary-information-available-funds-overspent-budgeted-and-for-next-month-3-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/budget.test.ts-snapshots/Budget-transfer-funds-to-another-category-1-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/budget.test.ts-snapshots/Budget-transfer-funds-to-another-category-2-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/budget.test.ts-snapshots/Budget-transfer-funds-to-another-category-3-chromium-linux.png is excluded by !**/*.png
  • upcoming-release-notes/4692.md is excluded by !**/*.md
📒 Files selected for processing (1)
  • packages/desktop-client/src/components/budget/MonthPicker.tsx (3 hunks)
🔇 Additional comments (4)
packages/desktop-client/src/components/budget/MonthPicker.tsx (4)

5-8: Icon imports look good!

The chevron icons are correctly imported and grouped in a consistent manner.


111-128: Previous month navigation button is well implemented.

The button follows the same pattern as the existing "Today" button with consistent styling and behavior. Good use of the translation function for the title attribute, which helps with accessibility.


238-255: Next month navigation button is properly implemented.

The implementation is consistent with the previous month button and follows the component's styling patterns. The marginLeft (instead of marginRight) is appropriate for this button's position.


238-263:

❓ Verification inconclusive

Verify layout balance with the new buttons.

The code includes a span with fixed width and margin after the next month button with a comment "Keep range centered". Ensure this still correctly balances the layout with the addition of the new navigation buttons.


🏁 Script executed:

#!/bin/bash
# Look for any layout-related tests or snapshots that might need updating
fd -e test.tsx -e test.js -e spec.tsx -e spec.js | grep -i monthpicker

Length of output: 72


Ensure Layout Balance with New Navigation Buttons – Manual Verification Required

While the code appears to center the range using a fixed-width span after the "Next month" button, no tests or snapshots related to the MonthPicker component were found. Please manually verify in the UI that the addition of the new navigation buttons still correctly balances the layout.

  • Location: packages/desktop-client/src/components/budget/MonthPicker.tsx (lines 238-263)
  • Action: Manually inspect the UI or run visual regression tests to ensure the fixed-width span (width: 22px, marginLeft: 12px) continues to balance the layout as intended with the new navigation buttons.
✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant