Skip to content

Introduce intent-based colors, remove colors.ts #493

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

Merged
merged 38 commits into from
Apr 17, 2025

Conversation

opyh
Copy link
Member

@opyh opyh commented Feb 11, 2025

  • Removes hard-coded CSS color values where possible and points to the according Radix variables (fixing dark/bright mode)
  • introduces reusable CSS color aliases that you can use to signalize an intent in the UI (danger, warning, success)
  • tries to use CSS color variables instead of JS-based color where possible. This means, for example, that map marker colors are derived from the CSS.

Further reading:

On the way I've dared a mini refactoring to fix the totally-broken looking mapping events list UI. I hope that's okay :)

IMO the UI changes are only subtle and we'll have another round of polishing, so from my perspective, reviewing just the code would be enough here.

📎 Related Ticket

This code is based on #490. It needs rebasing onto feature/a11ymap before merging.

💪 I have tested my code - [x] The feature deployment works. - [x] The automated tests are passing. - [x] I have manually tested this feature - [x] in Chrome - [ ] in Firefox - [ ] in Safari
🧼 I have cleaned up my code - [x] I have removed dependencies that were just for testing. - [x] I have removed debug logging. - [x] My code does not generate new warnings. - [x] My code does not depend on new vulnerable packages. - [x] The commit messages are precise and make sense (rebase the PR with `--interactive` if applicable, keeping commits in sensible chunks if possible).
🔍 I have performed a self-review of my code - [x] My code is self-documenting or has links to necessary documentation. - [x] New function and variables names can be understood by new developers with basic project knowledge. - [x] The feature fits the design.

@opyh opyh marked this pull request as ready for review February 11, 2025 20:37
@opyh opyh requested review from kriskbx and Mayaryin February 12, 2025 14:36
Base automatically changed from chore/merge-editing-and-linting to feature/a11ymap February 12, 2025 14:43
@opyh opyh force-pushed the chore/refactor-shared-colors branch from bca44d4 to 14a0dd4 Compare February 12, 2025 14:49
@kriskbx kriskbx self-assigned this Feb 17, 2025
Copy link
Member

@kriskbx kriskbx left a comment

Choose a reason for hiding this comment

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

Hey, thanks a ton for your amazing PR ❤️

Great work on the mapping event UI! 💪

issue (non-blocking): There is still an old loading indicator in use that is visually broken now due to the changes. I think this is the src/components/Map/LoadingIndicator. When we're at it, we could replace it with the new one. Not blocking, though.
image

issue: When I try to open a mapping event locally and on the feature branch deployment, I get this error:
image
Don't know if this is related to the recent changes, but I cannot test the rest of the mapping event UI 🙁

@kriskbx kriskbx assigned opyh and unassigned kriskbx Feb 17, 2025
@opyh opyh force-pushed the chore/refactor-shared-colors branch 3 times, most recently from 9566db7 to 416d1ea Compare March 27, 2025 11:51
@opyh opyh force-pushed the chore/refactor-shared-colors branch from c094e76 to 93fdeea Compare March 27, 2025 14:45
kriskbx added 12 commits April 15, 2025 13:33
WIP

feat: add sheet to maplayout, refactor app context

chore: remove spinner

feat: remove unused things, create needs-refactoring directory

# Conflicts:
#	src/components/App/MapLayout.tsx
#	src/components/NodeToolbar/Equipment/getEquipmentInfoDescription.ts
#	src/components/TopBar.tsx
#	src/lib/context/AppContext.tsx
#	src/lib/context/Registry.tsx
#	src/lib/i18n/parseAcceptLanguageString.ts
#	src/lib/model/geo/placeNameFor.ts
#	src/lib/util/strings/formatDistance.ts
#	src/modules/accessibility-cloud/hooks/useAccessibilityCloud.ts
#	src/modules/categories/hooks/useCategory.ts
#	src/modules/categories/types/ACCategory.ts
#	src/modules/categories/utils/localization.ts
#	src/modules/i18n/utils/headers.ts
#	src/modules/osm-api/hooks/useOsmApi.ts
#	src/modules/search/components/SearchResult.tsx
#	src/modules/search/hooks/useSearchResults.ts
#	src/needs-refactoring/components/App/HeadMetaTags.tsx
#	src/needs-refactoring/components/CombinedFeaturePanel/components/AccessibilitySection/AddWheelchairDescription.tsx
#	src/needs-refactoring/components/CombinedFeaturePanel/components/AccessibilitySection/NextToiletDirections.tsx
#	src/needs-refactoring/components/CombinedFeaturePanel/components/AccessibilitySection/OSMTagPanel.tsx
#	src/needs-refactoring/components/CombinedFeaturePanel/components/AccessibilitySection/OSMTagTable.tsx
#	src/needs-refactoring/components/CombinedFeaturePanel/components/AccessibilitySection/PlaceAccessibility/AccessibilityDetailsTree.tsx
#	src/needs-refactoring/components/CombinedFeaturePanel/components/AccessibilitySection/PlaceAccessibility/AccessibilityItems.tsx
#	src/needs-refactoring/components/CombinedFeaturePanel/components/AccessibilitySection/determineIfZerothLevelIsSkippedHere.tsx
#	src/needs-refactoring/components/CombinedFeaturePanel/components/AccessibilitySection/determineIfZerothLevelShouldBeSkipped.tsx
#	src/needs-refactoring/components/CombinedFeaturePanel/components/FeatureNameHeader.tsx
#	src/needs-refactoring/components/CombinedFeaturePanel/components/IconButtonList/AddressMapsLinkItems.tsx
#	src/needs-refactoring/components/CombinedFeaturePanel/editors/AutoEditor.tsx
#	src/needs-refactoring/components/CombinedFeaturePanel/editors/StringFieldEditor.tsx
#	src/needs-refactoring/components/CombinedFeaturePanel/editors/WheelchairEditor.tsx
#	src/needs-refactoring/components/CombinedFeaturePanel/utils/useFeatureLabel.tsx
#	src/needs-refactoring/components/Map/GeolocateButton.tsx
#	src/needs-refactoring/components/Map/LoadingIndictor.tsx
#	src/needs-refactoring/components/Map/MapLayers.tsx
#	src/needs-refactoring/components/Map/MapView.tsx
#	src/needs-refactoring/components/Map/useMapStyle.tsx
#	src/needs-refactoring/components/MappingEvents/MappingEventMetadata.tsx
#	src/needs-refactoring/components/Onboarding/LocationNoPermissionStep.tsx
#	src/needs-refactoring/components/Onboarding/LocationStep.tsx
#	src/needs-refactoring/components/Onboarding/OnboardingStep.tsx
#	src/needs-refactoring/components/Onboarding/getProductName.ts
#	src/needs-refactoring/components/Onboarding/useProductName.ts
#	src/needs-refactoring/components/navigation/Navigation.tsx
#	src/needs-refactoring/lib/context/CountryContext.tsx
#	src/needs-refactoring/lib/context/EnvContext.tsx
#	src/needs-refactoring/lib/context/HostnameContext.tsx
#	src/needs-refactoring/lib/context/LanguageTagContext.tsx
#	src/needs-refactoring/lib/context/Registry.tsx
#	src/needs-refactoring/lib/context/StyledComponentsRegistry.tsx
#	src/needs-refactoring/lib/context/UserAgentContext.tsx
#	src/needs-refactoring/lib/getEquipmentInfoDescription.ts
#	src/needs-refactoring/lib/i18n/Locale.ts
#	src/needs-refactoring/lib/i18n/LocalizedString.ts
#	src/needs-refactoring/lib/i18n/expandedPreferredLocales.ts
#	src/needs-refactoring/lib/i18n/findMostUsableLanguageTag.ts
#	src/needs-refactoring/lib/i18n/getBrowserLanguageTags.tsx
#	src/needs-refactoring/lib/i18n/getLocalizedStringTranslation.ts
#	src/needs-refactoring/lib/i18n/getLocalizedStringTranslationWithMultipleLocales.ts
#	src/needs-refactoring/lib/i18n/i18n.ts
#	src/needs-refactoring/lib/i18n/isScript.ts
#	src/needs-refactoring/lib/i18n/languageTagsForStringFieldEditor.ts
#	src/needs-refactoring/lib/i18n/localeFromString.ts
#	src/needs-refactoring/lib/i18n/nextFallbackLocale.ts
#	src/needs-refactoring/lib/i18n/normalizeLanguageCode.ts
#	src/needs-refactoring/lib/i18n/parseAcceptLanguageString.ts
#	src/needs-refactoring/lib/i18n/useTranslatedStringFromObject.ts
#	src/needs-refactoring/lib/model/geo/placeNameFor.ts
#	src/needs-refactoring/lib/model/geo/shouldPreferImperialUnits.ts
#	src/needs-refactoring/lib/model/geo/usePlaceNameFor.ts
#	src/needs-refactoring/lib/model/osm/tag-config/getOSMTagProps.ts
#	src/needs-refactoring/lib/useAppLink.tsx
#	src/needs-refactoring/lib/useEquipmentInfoDescription.ts
#	src/needs-refactoring/lib/util/patchClientFetch.ts
#	src/needs-refactoring/lib/util/request.ts
#	src/needs-refactoring/lib/util/response.ts
#	src/needs-refactoring/lib/util/strings/formatDistance.ts
#	src/needs-refactoring/lib/util/strings/useFormatDistance.ts
#	src/needs-refactoring/pages/[placeType]/[id]/report/mail-to-support.tsx
#	src/needs-refactoring/pages/events/[id]/index.tsx
#	src/needs-refactoring/pages/events/[id]/welcome.tsx
#	src/pages/_app.tsx
#	src/pages/_events/[id]/index.tsx
#	src/pages/_events/[id]/welcome.tsx
#	src/pages/_events/index.tsx
#	src/pages/events/[id]/index.tsx
#	src/pages/events/[id]/welcome.tsx
#	tests/e2e/onboarding-without-location.e2e-spec.ts

# Conflicts:
#	src/modules/categories/tests/category-filter.e2e-spec.ts
#	src/modules/needs/tests/needs-picker.e2e-spec.ts
#	src/modules/search/tests/search-input.e2e-spec.ts
#	tests/e2e/onboarding-without-location.e2e-spec.ts

# Conflicts:
#	src/components/App/MapLayout.tsx
#	src/modules/needs/tests/needs-picker.e2e-spec.ts
#	src/modules/search/tests/search-input.e2e-spec.ts
#	tests/e2e/onboarding-without-location.e2e-spec.ts
#	tests/e2e/utils/skipOnboarding.ts
@kriskbx kriskbx changed the base branch from feature/a11ymap to feat/sheet April 17, 2025 09:37
@kriskbx kriskbx force-pushed the chore/refactor-shared-colors branch 2 times, most recently from 0ab9d1e to 4fe8d5c Compare April 17, 2025 10:04
Copy link
Member

@kriskbx kriskbx left a comment

Choose a reason for hiding this comment

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

LGTM

kriskbx added 4 commits April 17, 2025 16:13
WIP

feat: add sheet to maplayout, refactor app context

chore: remove spinner

feat: remove unused things, create needs-refactoring directory
chore: update package-lock

chore: clean up css

chore: remove search panel

fix: icon colors

fix: dark mode

refactor: remove background color property from icon marker
Base automatically changed from feat/sheet to feature/a11ymap April 17, 2025 14:49
@kriskbx kriskbx force-pushed the chore/refactor-shared-colors branch from f558167 to 194673c Compare April 17, 2025 14:58
@kriskbx kriskbx force-pushed the chore/refactor-shared-colors branch from 194673c to fc26bc8 Compare April 17, 2025 15:14
@kriskbx kriskbx merged commit 9281e2d into feature/a11ymap Apr 17, 2025
1 of 2 checks passed
@kriskbx kriskbx deleted the chore/refactor-shared-colors branch April 17, 2025 15:15
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