-
-
Notifications
You must be signed in to change notification settings - Fork 159
feat: Finish the new product page revamp based on the Attributes API - Implementation of product attributes - Pr/#707 #780
Conversation
Maybe remove the visual impact from these changes from the other pull request. And finish/merge it. The visual/usage part can then be done here. |
@aleene You are right, that is the best course of action. |
Got my custom AttributeTableViewCell to work. To test it I am only displaying the first attribute from the first group of this product "Crème entière fluide Bio (30 % MG)"
It works in multi-language because the Product Attributes are requested in the users language set in the app's preferences. |
No major changes, got a couple of the Product Attribute icons to display, but only the icons of the Labels, which were .png, and none of the others because they were .svg (like Nutrition Level icons or Allergen icons) Here is the data I tested with |
Starting to look very good. |
I saw the thread on Slack about the PNG vs SVG difficulties in Swift. I agree, working with PNGs is much easier. Here are the latest results from my progress today, and here is the data I tested with. It does not yet look like your mock-up on #707 but I will make the necessary adjustments. I just ripped the code from IngredientAnalysisView.swift to get the same functionality, so the formatting of the pop-up is the same right now. Some other little things I need to finish:
|
Now the @teolemon @stephanegigandet will the server go back to PNGS for the product attributes icons or will I need to work with the SVGs? I have added the AttributeView to the BLTN pop-up card to make it look more like the mock-up in #707 |
I've merged the underlying code (previous PR into develop) @jncosideout @aleene |
@teolemon Excellent. I will squash the commits in this branch and merge in 'develop' As a quick update: and here is a mock-up of the little grey-handle I was talking about. This is what I was going for: but I gave up on that. I tried adding a PNG with a UIImageView and also tried using code to draw the line. I could go back to the way it was with the grey circle with the X in the center, but that was sometimes overlapping long labels. |
@jncosideout We use Floating Panel somewhere else in the app: https://github.com/SCENEE/FloatingPanel |
Oh! I should have known not to reinvent the wheel. Thank you, @teolemon |
46b7a92
to
a81eedf
Compare
a81eedf
to
9af81d9
Compare
Status update: I'm still working on changing my design from using the BLTNPageItem to the FloatingPanelViewController. I've managed to set up the FloatingPanelVC by extending ProductDetailVC, but I'm having trouble displaying my content on the FloatingPanel view. See my latest commit for more detail. |
the red and green are for my visual debugging purposes I don't think we want it to display in 'full' covering the entire screen, so I will change that soon to 'half' once I iron out the layout discrepancies, such as adding in the Also, I need to run some performance tests and use xcode Instruments' Allocations tool to make sure I haven't introduced memory leaks. |
If the left padding is for the image, possibly this to flow around the image and loose less space: https://stackoverflow.com/questions/44332928/xcode-swift-how-to-wrap-text-around-image |
Hi @jncosideout , thank you for your work!
Happy to help |
@teolemon @aleene @philippeauriach
I still want to add
Here is the result of my latest work (remember that I'm using coloring to debug the ui): |
The feature is still the #1 priority @jncosideout 👍 |
ac04361
to
4c9a315
Compare
@teolemon @aleene @philippeauriach
When you all are satisfied with my work, I will squash my commits and push them one more time and then you can merge. |
Great find. Could this be happening elsewhere as well? (Can not test it, as my old mac no longer supports the latest xcode) |
@aleene @teolemon @philippeauriach
Yes, that is likely. I only tested viewing products in my history, not scanning new ones. But I noticed that four major view controllers are leaked within the first ten seconds of launching. They are each duplicated once, but thereafter no more copies were made when I tested.
I'm not running the latest xcode. I'm running 11.7, because as you and others well know, Carthage cannot build certain modules with the new version of swift in xcode 12.x. I even tried using XCFrameworks. So I fell back to 11.7 and that is also the version of Instruments that I ran my Allocations profiling tests on. So you could recreate it or, I could send you my .trace file of my tests. |
I think I figured out the source of the duplication of ScannerVC, SettingsTableVC, HistoryTVC, & SearchVC. They are all in Main.storyboard and I believe they are instantiated automatically when the app launches. Next, they are instantiated explicitly in code when RootViewController.init() is called in app delegate. So nothing to see here, these VC's aren't continuously leaking and they don't take up a large amount of memory anyway. However, as Arnaud mentioned, we should profile the app to try to find other memory leaks, and that should be a separate Issue & PR. |
PR Description
This PR was branched from PR #748 which at this time is still WIP and not merged. But it is complete enough to use for making a mock-up for Issue #707 which aims to create new rows on the prodoct summary page to display the Product Attributes, and show summary info cards from the data supplied by the Product Attributes API
Type of Changes
Proposed changes
Screenshots
Before
After
Checklist
Make sure you've done all the following (Put an
x
in the boxes that apply.)Part of