Improve page dialog (user) #8224

Merged
dmfrodrigues merged 9 commits from improve-page-dialog-user into master 2024-05-23 08:23:02 +00:00
dmfrodrigues commented 2024-05-19 19:05:08 +00:00 (Migrated from github.com)
  1. Adds short description to place page dialog.
  2. Adds word-wrap for all long fields.
  3. Bug fix: removes duplicate Instagram.
  4. Adds some layout stretching.

Points 2 and 4 are in preparation to move the page dialog to a panel to the left of the map 🙂 (which I'll do in a separate PR). This will hopefully make the place page less of a nuisance when one specific place is selected but you still want to explore the surroundings, giving a more intuitive experience that is also consistent with the mobile version (where you can select a place, and then drag the map around to see the surroundings).

Before After
image image

@biodranik @Ferenc-

1. Adds short description to place page dialog. 2. Adds word-wrap for all long fields. 3. Bug fix: removes duplicate Instagram. 4. Adds some layout stretching. Points 2 and 4 are in preparation to move the page dialog to a panel to the left of the map :slightly_smiling_face: (which I'll do in a separate PR). This will hopefully make the place page less of a nuisance when one specific place is selected but you still want to explore the surroundings, giving a more intuitive experience that is also consistent with the mobile version (where you can select a place, and then drag the map around to see the surroundings). | Before | After | |-|-| | ![image](https://github.com/organicmaps/organicmaps/assets/43684166/24f696d4-8ed5-420b-9afa-ec1ba4f597ce) | ![image](https://github.com/organicmaps/organicmaps/assets/43684166/53bc96bc-663f-48f8-bccc-063ed69dfa6a) | @biodranik @Ferenc-
Ferenc- (Migrated from github.com) approved these changes 2024-05-22 07:42:28 +00:00
Ferenc- (Migrated from github.com) left a comment

LGTM

LGTM
biodranik (Migrated from github.com) reviewed 2024-05-22 20:32:56 +00:00
biodranik (Migrated from github.com) left a comment

A few minor nits.

A few minor nits.
biodranik (Migrated from github.com) commented 2024-05-22 20:31:02 +00:00
  auto const paragraphStart = description.find("<p>");
  auto const paragraphEnd = description.find("</p>");
```suggestion auto const paragraphStart = description.find("<p>"); auto const paragraphEnd = description.find("</p>"); ```
biodranik (Migrated from github.com) commented 2024-05-22 20:31:14 +00:00
    description = description.substr(3, paragraphEnd - 3);
```suggestion description = description.substr(3, paragraphEnd - 3); ```
biodranik (Migrated from github.com) commented 2024-05-22 20:31:59 +00:00
    description = description.substr(0, kMaxLengthOfPlacePageDescription - 3) + "...";
```suggestion description = description.substr(0, kMaxLengthOfPlacePageDescription - 3) + "..."; ```
biodranik (Migrated from github.com) commented 2024-05-22 20:32:48 +00:00

There are many memory allocations here for string processing, but... ok.

There are many memory allocations here for string processing, but... ok.
biodranik (Migrated from github.com) commented 2024-05-22 20:27:38 +00:00
    if (auto const addressFormatted = address.FormatAddress(); !addressFormatted.empty())
    {
```suggestion if (auto const addressFormatted = address.FormatAddress(); !addressFormatted.empty()) { ```
biodranik (Migrated from github.com) commented 2024-05-22 20:27:56 +00:00
    if (auto const subTitle = info.GetSubtitle(); !subTitle.empty())
    {
```suggestion if (auto const subTitle = info.GetSubtitle(); !subTitle.empty()) { ```
biodranik (Migrated from github.com) commented 2024-05-22 20:28:07 +00:00
    if (!title.empty())
    {
```suggestion if (!title.empty()) { ```
dmfrodrigues (Migrated from github.com) reviewed 2024-05-22 20:46:56 +00:00
dmfrodrigues (Migrated from github.com) commented 2024-05-22 20:46:56 +00:00

Addressed using string_view. IMO not as pretty, but it's two less allocations.

Addressed using string_view. IMO not as pretty, but it's two less allocations.
biodranik (Migrated from github.com) reviewed 2024-05-22 20:58:53 +00:00
biodranik (Migrated from github.com) commented 2024-05-22 20:58:52 +00:00

If string_view is used, can it be passed as an argument, and returned from the function, to avoid two more allocations?

If string_view is used, can it be passed as an argument, and returned from the function, to avoid two more allocations?
dmfrodrigues (Migrated from github.com) reviewed 2024-05-22 21:46:15 +00:00
dmfrodrigues (Migrated from github.com) commented 2024-05-22 21:46:15 +00:00

Most likely can't return a view, since we need to add "..." at the end. But passing description as a const ref to this function would remove one more allocation.

Most likely can't return a view, since we need to add "..." at the end. But passing description as a const ref to this function would remove one more allocation.
dmfrodrigues (Migrated from github.com) reviewed 2024-05-22 21:50:19 +00:00
dmfrodrigues (Migrated from github.com) commented 2024-05-22 21:50:19 +00:00

Modified getShortDescription to receive a const string ref.

Modified `getShortDescription` to receive a const string ref.
biodranik (Migrated from github.com) approved these changes 2024-05-23 08:22:41 +00:00
biodranik (Migrated from github.com) left a comment

Thanks! Hope it wasn't a waste of time ;-)

Thanks! Hope it wasn't a waste of time ;-)
This repo is archived. You cannot comment on pull requests.
No labels
Accessibility
Accessibility
Address
Address
Android
Android
Android Auto
Android Auto
Android Automotive (AAOS)
Android Automotive (AAOS)
API
API
AppGallery
AppGallery
AppStore
AppStore
Battery and Performance
Battery and Performance
Blocker
Blocker
Bookmarks and Tracks
Bookmarks and Tracks
Borders
Borders
Bug
Bug
Build
Build
CarPlay
CarPlay
Classificator
Classificator
Community
Community
Core
Core
CrashReports
CrashReports
Cycling
Cycling
Desktop
Desktop
DevEx
DevEx
DevOps
DevOps
dev_sandbox
dev_sandbox
Directions
Directions
Documentation
Documentation
Downloader
Downloader
Drape
Drape
Driving
Driving
Duplicate
Duplicate
Editor
Editor
Elevation
Elevation
Enhancement
Enhancement
Epic
Epic
External Map Datasets
External Map Datasets
F-Droid
F-Droid
Fonts
Fonts
Frequently User Reported
Frequently User Reported
Fund
Fund
Generator
Generator
Good first issue
Good first issue
Google Play
Google Play
GPS
GPS
GSoC
GSoC
iCloud
iCloud
Icons
Icons
iOS
iOS
Legal
Legal
Linux Desktop
Linux Desktop
Linux packaging
Linux packaging
Linux Phone
Linux Phone
Mac OS
Mac OS
Map Data
Map Data
Metro
Metro
Navigation
Navigation
Need Feedback
Need Feedback
Night Mode
Night Mode
NLnet 2024-06-281
NLnet 2024-06-281
No Feature Parity
No Feature Parity
Opening Hours
Opening Hours
Outdoors
Outdoors
POI Info
POI Info
Privacy
Privacy
Public Transport
Public Transport
Raw Idea
Raw Idea
Refactoring
Refactoring
Regional
Regional
Regression
Regression
Releases
Releases
RoboTest
RoboTest
Route Planning
Route Planning
Routing
Routing
Ruler
Ruler
Search
Search
Security
Security
Styles
Styles
Tests
Tests
Track Recording
Track Recording
Translations
Translations
TTS
TTS
UI
UI
UX
UX
Walk Navigation
Walk Navigation
Watches
Watches
Web
Web
Wikipedia
Wikipedia
Windows
Windows
Won't fix
Won't fix
World Map
World Map
No milestone
No project
No assignees
1 participant
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: organicmaps/organicmaps-tmp#8224
No description provided.