littleprinters-ios-app icon indicating copy to clipboard operation
littleprinters-ios-app copied to clipboard

Long printer name can overflow in printer list

Open Neelfyn opened this issue 4 years ago • 3 comments

Steps to reproduce

  1. Add a Little Printer with a longer name to the app, for example "Neelfyn's Little Printer" on an iOS device with a 4" screen.
  2. Go to the main screen with the list of Little Printers.

Expected result

The printer name is truncated with an ellipsis, or wraps to a new line.

Actual result

The printer name stacks with the key icon, and overflows outside of the box:

lp_title_overflow

This is a purely cosmetic issue, the usability of the key icon is not affected.

Configuration: iPod touch 7th generation, iOS 13.7, Little Printers 1.0.1.

Neelfyn avatar Sep 13 '20 10:09 Neelfyn

Thanks for the report! Looks like a missing UI constraint in https://github.com/nordprojects/littleprinters-ios-app/blob/master/littleprinter/UI/Printers/PrinterListTableViewCell.swift#L135

Happy to review a PR if you're interested!

joerick avatar Sep 13 '20 12:09 joerick

@joerick Thanks for the tip! I'm not super familiar with Swift, but purely based on what the rest looks like, make.right.equalTo(shareButton.snp.left) appears to fix this for me. Not sure whether the margin for the key icon is handled elsewhere, but it looks fine to me without specifying a negative offset.

I suppose ownerLabel could also benefit from something like make.right.equalTo(cardImageView).offset(-6) while we're looking at this.

If this is an acceptable solution for you, I'll be happy to create a PR!

Neelfyn avatar Sep 13 '20 15:09 Neelfyn

Sounds good to me!

joerick avatar Sep 14 '20 07:09 joerick