Skip to content
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-958] Ai page polish #1847

Merged
merged 2 commits into from
Sep 6, 2023
Merged

[MBL-958] Ai page polish #1847

merged 2 commits into from
Sep 6, 2023

Conversation

ifosli
Copy link
Contributor

@ifosli ifosli commented Aug 31, 2023

📲 What

Convert the current "AI generation section" to all be one cell and update formatting to match android/web.

🤔 Why

We want to show separators between the different AI sections and green bars at the leading edge of the answers. This wasn't done when the questions were first added since we didn't have time to do so and get the code in the cut.

🛠 How

I considered both this approach and the approach of keeping the ai generation section as three different cells. I ultimately went with this approach because it felt more internally consistent to make the title part of the cell (and if we wanted to move the title out of the cell for all the titles on the AI page, we'd need to modify the environmental commitments tab as well) and because this felt less hacky than adding a showSeparator or endOfSection var to the current question answer cell. Happy to revisit this if anyone is curious; I mostly coded up both approaches while deciding what to do.

👀 See

JIRA

Before 🐛 After 🦋
Screenshot 2023-08-31 at 4 01 29 PM Screenshot 2023-08-31 at 3 08 09 PM
Simulator Screen Recording - iPhone 14 Pro Max - 2023-08-31 at 16 01 58 Simulator Screen Recording - iPhone 14 Pro Max - 2023-08-31 at 15 08 30

✅ Acceptance criteria

  • AI page looks good

@ifosli ifosli changed the title Ai page polish [MBL-958] Ai page polish Aug 31, 2023
@ifosli ifosli added this to the release-5.11.0 milestone Aug 31, 2023
@ifosli ifosli self-assigned this Aug 31, 2023
@codecov
Copy link

codecov bot commented Aug 31, 2023

Codecov Report

Merging #1847 (b4bd1db) into main (de2ae46) will decrease coverage by 0.02%.
The diff coverage is 97.08%.

@@            Coverage Diff             @@
##             main    #1847      +/-   ##
==========================================
- Coverage   84.61%   84.60%   -0.02%     
==========================================
  Files        1279     1276       -3     
  Lines      116126   116026     -100     
  Branches    30921    30892      -29     
==========================================
- Hits        98258    98158     -100     
  Misses      16786    16786              
  Partials     1082     1082              
Files Changed Coverage Δ
KsApi/models/ExtendedProjectProperties.swift 100.00% <ø> (ø)
...s/ProjectTabCategoryDescriptionCellViewModel.swift 78.57% <ø> (+3.57%) ⬆️
...els/graphql/adapters/Project+ProjectFragment.swift 89.84% <83.33%> (+0.06%) ⬆️
...tPage/Views/Cells/ProjectTabAIGenerationCell.swift 97.24% <97.24%> (ø)
...ectPage/Controller/ProjectPageViewController.swift 50.39% <100.00%> (-0.08%) ⬇️
...ge/Controller/ProjectPageViewControllerTests.swift 100.00% <100.00%> (ø)
...tasource/ProjectPageViewControllerDataSource.swift 83.76% <100.00%> (-2.64%) ⬇️
...rce/ProjectPageViewControllerDataSourceTests.swift 97.41% <100.00%> (-0.04%) ⬇️
.../adapters/Project+FetchProjectQueryDataTests.swift 95.47% <100.00%> (ø)
...raphql/adapters/Project+ProjectFragmentTests.swift 97.30% <100.00%> (ø)

... and 1 file with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Contributor

@msadoon msadoon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea, good simplification for this cell and nice styling for the green bar.
I see what you were saying about the separator under "Learn more", but it's fine to let go. All the other separators on this page are fine.

@@ -64,6 +63,11 @@ public struct ProjectTabCategoryDescription {
public var id: Int
}

public struct ProjectTabGenerationDisclosure: Equatable {
Copy link
Contributor

@msadoon msadoon Sep 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a better organized strut - did you consider what happens if there are more than two string sections in the future?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I understand the question. Do you mean what we'd do if the backend wants to add another question and answer to this section? Because if so, I think we'd either just create another view like the two we have, or we could use enums with an associated string (enum value representing the question and associated value representing the user-provided string) to simplify the code a bit. It'd be similar to the way we currently handle the checkmark cell. Though hopefully by that point, this will be rewritten in swiftui!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol, sure. I was just thinking we'd just send an array of strings into this function and in the cell, do a forEach on each String to create the views.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'd still need a way to tell what question/title each string is associated with, so we can't just do an array. But let's shelve this for if it becomes relevant :)

@ifosli ifosli merged commit 16567fe into main Sep 6, 2023
2 checks passed
@ifosli ifosli deleted the aiPagePolish branch September 6, 2023 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants