derf / travelynx

Traewelling-inspired journey logger with realtime data
https://travelynx.de
GNU Affero General Public License v3.0
102 stars 16 forks source link

further unify train line chips #118

Open deingithub opened 4 months ago

deingithub commented 4 months ago

Currently, the departure board uses the train type as the determining factor for styling. Some private operators like Metronom, erixx, VIAS oder SBB GmbH use a three-letter abbreviation of the company name as the train type and smush the train type and line number into the line data field. This leads to RE lines being displayed in gray instead of orange, for example: Screenshot 2024-02-15 at 20-08-36 travelynx Unterlüß Also in the current implementation it is not possible to tell apart two-digit train numbers with long distance trains from the line numbers the HAFAS departure board can display: Screenshot 2024-02-15 at 20-08-56 travelynx Hannover Hbf Is that ICE number 72 or some train on ICE line 72?

This patch adds improvements for both of these visual issues. If a train has a type we don't know about AND the line number starts with a train type we do know about, we can treat that as the actual train type to display: Screenshot 2024-02-15 at 19-57-57 travelynx Unterlüß Outside of the departure board, the assumed operator prefix is not hidden and gets added in front of the train number like this: Screenshot 2024-02-15 at 20-18-22 travelynx

Train lines are now visually distinguished from train numbers. Train numbers are set in semi-bold and roman type. Train lines keep the formatting already applied to them, for long-distance trains that means italic and full bold. Screenshot 2024-02-15 at 19-57-20 travelynx Leipzig Hbf Screenshot 2024-02-15 at 19-56-33 travelynx Hannover Hbf

The patch also allows the _format_train template to be used in all contexts and not just for checked-in statuses. It is now uniformly used in all the places that display train numbers that was able to find, including departure board and history entries. It also adds the train types RNV (displayed like STR), Schw-B (like U) and CJX (like RE) to the set of styled train types.

deingithub commented 4 months ago

apropos schwebebahn: maybe instead of the very long Schw-B that leads to this big chip with line-wrapping this could be a case where using an emoji substitute can be nice? Screenshot 2024-02-15 at 20-42-04 travelynx Kluse Wuppertal vs Screenshot 2024-02-15 at 20-41-43 travelynx Kluse Wuppertal