From 2bd5421bedf04249bcede97ca30cb55b9ae3b1ea Mon Sep 17 00:00:00 2001 From: miles-grant-ibigroup Date: Thu, 13 Jun 2024 11:44:58 -0400 Subject: [PATCH 1/2] nearby view new `alwaysShowLongName` setting --- example-config.yml | 5 ++++- lib/components/viewers/nearby/stop.tsx | 1 + lib/components/viewers/pattern-row.tsx | 7 +++++++ lib/util/config-types.ts | 1 + 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/example-config.yml b/example-config.yml index 0bc4e0feb..1a635d9d1 100644 --- a/example-config.yml +++ b/example-config.yml @@ -668,4 +668,7 @@ itinerary: ### Setting this to true will use the route viewer sort algorithm on routes # useRouteViewSort: false ### Setting this to false will hide the shadowey dot that appears when dragging the map -# showShadowDotOnMapDrag: false \ No newline at end of file +# showShadowDotOnMapDrag: false +### In routes, this will always show the routeLongName before the headsign +### !!! WARNING: in some feeds, this may show the long name twice. In some feeds, this may crash !!! +# alwaysShowLongName: false \ No newline at end of file diff --git a/lib/components/viewers/nearby/stop.tsx b/lib/components/viewers/nearby/stop.tsx index 0fdc0a694..86a210f21 100644 --- a/lib/components/viewers/nearby/stop.tsx +++ b/lib/components/viewers/nearby/stop.tsx @@ -62,6 +62,7 @@ const Stop = ({ ) return ( { * viewer. */ const PatternRow = ({ + alwaysShowLongName, homeTimezone, pattern, roundedTop = true, @@ -101,6 +103,11 @@ const PatternRow = ({ /> + {alwaysShowLongName && ( + + {pattern.route.longName} + + )} {extractHeadsignFromPattern(pattern) || (pattern.route.longName !== routeName && pattern.route.longName)} diff --git a/lib/util/config-types.ts b/lib/util/config-types.ts index e8008d9eb..8ee11a359 100644 --- a/lib/util/config-types.ts +++ b/lib/util/config-types.ts @@ -69,6 +69,7 @@ export type BugsnagConfig = ApiKeyConfig export type MapillaryConfig = ApiKeyConfig export type NearbyViewConfig = { + alwaysShowLongName?: boolean hideEmptyStops?: boolean radius?: number showShadowDotOnMapDrag?: boolean From d4a0e3dc560d9403b993b69b7d83b6d0a61cf077 Mon Sep 17 00:00:00 2001 From: miles-grant-ibigroup Date: Tue, 25 Jun 2024 12:40:18 -0400 Subject: [PATCH 2/2] layout issues instead of crash --- example-config.yml | 2 +- lib/components/viewers/pattern-row.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/example-config.yml b/example-config.yml index 1a635d9d1..e87208b9d 100644 --- a/example-config.yml +++ b/example-config.yml @@ -670,5 +670,5 @@ itinerary: ### Setting this to false will hide the shadowey dot that appears when dragging the map # showShadowDotOnMapDrag: false ### In routes, this will always show the routeLongName before the headsign -### !!! WARNING: in some feeds, this may show the long name twice. In some feeds, this may crash !!! +### !!! WARNING: in some feeds, this may show the long name twice. In some feeds, this may cause layout issues !!! # alwaysShowLongName: false \ No newline at end of file diff --git a/lib/components/viewers/pattern-row.tsx b/lib/components/viewers/pattern-row.tsx index 837673da0..980a28a11 100644 --- a/lib/components/viewers/pattern-row.tsx +++ b/lib/components/viewers/pattern-row.tsx @@ -103,7 +103,7 @@ const PatternRow = ({ /> - {alwaysShowLongName && ( + {alwaysShowLongName && !!pattern.route.longName && ( {pattern.route.longName}