Skip to content

Conversation

@ssk033
Copy link

@ssk033 ssk033 commented Dec 3, 2025

This pull request introduces two major improvements to the OSMCha frontend: pagination for the Discussions component and a global dark/light theme toggle. The discussions section now loads the first 10 comments by default and allows users to load additional comments in batches of 10 using a “Load More” button, resulting in significantly better performance and user experience for changesets with long discussion threads. Additionally, a complete dark/light theme system has been implemented using a React Context–based ThemeProvider, a new theme toggle button in the navbar, persistent theme preference via localStorage, and comprehensive dark-mode styling across all major UI components. These enhancements improve accessibility, reduce initial render time, and provide a more modern, customizable interface for users.

- Add ThemeContext for theme management with localStorage persistence
- Add theme toggle button in navbar
- Add dark theme CSS styles
- Add pagination to discussions component (load 10 at a time with Load More button)
@jake-low
Copy link
Contributor

jake-low commented Dec 3, 2025

Hi @ssk033, thanks for opening this PR. I see that this is your first time contributing to OSMCha. I have a few questions about the changes you're proposing. This PR appears to make two unrelated changes (discussion comments and dark mode) so I'll address each individually. In the future it's better to divide these changes into separate PRs.

"Load more" button for discussion comments

Can you tell me more about your reason for this change? You mention improved performance, but your code changes only affect the way comments are displayed (all comments are loaded in one request, but then only the first 10 are shown until you click "Load more"). I suspect that for changesets with many comments, the slowest part is loading the data, not rendering it. The OSM API doesn't support pagination for discussion comments (we must load them all at once), so limiting how many are shown initially doesn't seem very useful.

Dark mode

I'm open to adding dark mode support to OSMCha's UI, but I would prefer doing this in CSS using the prefers-color-scheme media query. This makes the website follow whatever preference the user has set in their browser or OS, and doesn't require adding a toggle switch to the OSMCha UI.

If you want to add dark mode support, I'd also appreciate if you add some screenshots to your PR to make it easier to review. I'd like to make sure that dark mode is fully supported across all screens in the app (and has good visual accessibility, i.e. sufficient foreground-background contrast and color differentiation) before merging it; a half-baked dark mode is worse than no dark mode at all.

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.

2 participants