New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[MBL-902] [MBL-934] [MBL-928] Use of AI Screen, Analytics, Question Headers, Translations #1843
Conversation
…arter/ios-oss into mbl-900/new-tab-use-of-ai
…ue in the check mark I will note.
Generated by 🚫 Danger |
Kickstarter-iOS/Features/ProjectPage/Views/Cells/ProjectTabCheckmarkListCell.swift
Show resolved
Hide resolved
Kickstarter-iOS/Features/ProjectPage/Views/Cells/ProjectTabDisclaimerCell.swift
Outdated
Show resolved
Hide resolved
…rter/ios-oss into mbl-902/use-of-ai-screen
…ely represented here.
…rter/ios-oss into mbl-902/use-of-ai-screen
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, I think this is almost done! We're just missing the green bars (which should be on the leading edge of the answers only). I like that you split the title into its own cell, but now both that title cell and the other AI page cells can be simplified. Some of this can probably be polish follow-up work if needed, but please take a look at my comments, especially the feature flag check that I think has been removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we're missing a separator between the generation cell and the other cell - it looks weird to have a separator between the first two cells but not the second two. Or, alternatively, we can get rid of the separator after the first cell, and just keep the footer ones.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The separator logic is a little tricky to hammer out right now.
Basically every cell has a separator, but each cell can be re-used. So example the ProjectQuestionAndAnswerCell
is used twice with the last cell having the separator. I could technically put in some logic to update the UI for the last cell and ignore it for the others, but given the time constraints on this, can I suggest it be an improvement along with the green bar?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm okay with fixing this later. I'd rather have missing separators than have a separator between the questions in the meanwhile, especially since that separator doesn't respect the leading margin.
if aiDisclosure.funding.fundingForAiAttribution || aiDisclosure.funding | ||
.fundingForAiConsent || aiDisclosure.funding.fundingForAiOption { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should be checking that .involvesFunding
is true here, in addition to this check.
self.appendRow( | ||
value: Strings.I_plan_to_use_AI_generated_content(), | ||
cellClass: ProjectTabTitleCell.self, | ||
toSection: Section.aiDisclosureGenerated.rawValue | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should only add this section if .involvesGeneration
is true
) | ||
} | ||
|
||
if let otherAIDetailValues = aiDisclosure.otherAiDetails { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And here we should also check that .involvesOther
is true
@@ -65,8 +65,13 @@ public final class ProjectNavigationSelectorViewModel: ProjectNavigationSelector | |||
|
|||
let moreTabs: [NavigationSection] = [.campaign, .faq, .risks] | |||
|
|||
let includeAIDisclosure = extendedProjectProperties | |||
.aiDisclosure != nil && featureUseOfAIProjectTabEnabled() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this not going to roll out behind a feature flag after all? I'm concerned.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes! completely missed this, nice catch! Really important actually.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not opposed to this title being its own cell, but I think we should use it for all the titles instead of letting the checkmark and category description cells have their own copies.
I'm also confused by why it still has a stack view when the stack view only contains one element.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yea, I used a stackview because it was simpler to re-use the code from ProjectFAQCell
alongside styling that currently existed.
We can rework all title cells to be there own cell, sure - but it's a lot of overhead on this time-constrainted PR. We want to kind of limit the scope of changes to this tab - not all possible cells in every tab.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While the difference between title as its own cell or incorporated into other cells isn't noticeable visually, it's still different. In voiceover, for example, it's very obvious and pretty weird actually. I really think we should be consistent across both the ai tab and the environmental tab. I agree that it's a bigger change than what's currently in this PR (hence why I didn't think I could land the questions/answers in this 5.10). Doing it the way you're currently doing it (keeping the stack view and having the title be its own cell in only one place) is quick and simple, but it's adding tech debt. I don't think we want these changes to live like this in the long run, but I'm okay with doing it this way in this pr (though ideally with added FIXME
tags) as long as we're planning to clean it up asap. I don't think our app is in a state where we want to create more tech debt.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hear you on the tech debt. Honestly though the way we have UIKit used in the app (alongside Prelude) is all tech debt. We should be using SwiftUI. To remove all the tech debt in this title cell and the others, we should be building those views in SwiftUI.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The question is indented weirdly and the answer is missing the green bar. I think if we need to do the green bars as a fast follow for the next release, we probably can, but can you fix the indentation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I'll remove the indent - I thought it might be good as an indicator for different questions from title. If we're doing a green bar though I'll remove the indent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The green bar is only along the answer, not the questions. I think the title and the question are primarily differentiated by their different fonts. I don't remember exactly what they looked like on android, though.
Codecov Report
@@ Coverage Diff @@
## main #1843 +/- ##
==========================================
+ Coverage 84.54% 84.61% +0.07%
==========================================
Files 1272 1279 +7
Lines 115378 116126 +748
Branches 30710 30921 +211
==========================================
+ Hits 97542 98260 +718
- Misses 16767 16784 +17
- Partials 1069 1082 +13
... and 1 file with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
…rter/ios-oss into mbl-902/use-of-ai-screen
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! I think all remaining work can happen in the next cut now :)
📲 What
Biggest piece of the puzzle is to attach the data to the UI. These were the designs followed:
🤔 Why
We need to display the UI on this tab.
🛠 How
generated
andother
AI fields.ProjectEnvironmentalCommitmentCell
-->ProjectTabCategoryDescriptionCell
ProjectEnvironmentalCommitmentDisclaimerCell
-->ProjectTabDisclaimerCell
ProjectTabCheckmarkListCell
for thefunding
fields.ProjectPageViewControllerDataSource
to have the new sections. This is the main piece of this PR. It reloads the table for each tab change. Probably the most important thing to understand for the how the project page works.👀 See
Before 🐛
Simulator.Screen.Recording.-.iPhone.8.-.2023-08-08.at.20.00.38.mp4
After �
Simulator.Screen.Recording.-.iPhone.14.Pro.Max.-.2023-08-22.at.13.21.34.mp4
Simulator.Screen.Recording.-.iPhone.14.Pro.Max.-.2023-08-22.at.13.22.41.mp4
Note: You'll notice the check mark is slightly above the text and it looks a little funny. I spent hours trying to pad the
UIImageView
andImage
top. If either of you have any suggestions please try it out and let me know.*Note: This ticket blew up a bit due to time constraints. All things listed in TODO now encapsulate the completed feature tab.
✅ Acceptance criteria
⏰ TODO
ProjectNavigationSelectorViewModel
line 68
. “if the AI data is present, and if there is no AI data present on a project, do not display the tab” that is exactly how the current implementation works, with the addition that, if the feature flag is not enabled, the tab will never be visible. Right now I just check the data is there, but there's a boolean check that should override this, it's one of the returned properties.Page Viewed
segment event.FIXME:// MBL-902
for pointers but there's probably more. General strategy is to look at how the each file was tested previously and extend the tests for this tab.