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

feat(debug): add debug menu #716

Merged
merged 2 commits into from
May 8, 2023
Merged

feat(debug): add debug menu #716

merged 2 commits into from
May 8, 2023

Conversation

cyndichin
Copy link
Contributor

@cyndichin cyndichin commented May 8, 2023

Summary

PR to add debug menu to iOS app

References

N / A

Implementation Details

Added basic debug menu to Settings that shows user identifier and sets up UI for snowplow configuration and feature flag values.

Test Steps

  • Add your user ID to https://featureflags.readitlater.com/projects/default/features/perm.ios.debug.menu if you would like the debug menu feature flag to be turned on
  • Navigate to Settings and view the Debug Menu as shown in screenshot

PR Checklist:

  • N / A Added Unit / UI tests
  • Self Review (review, clean up, documentation, run tests)
  • Basic Self QA

Screenshots

Entry Debug Menu
Simulator Screenshot - iPhone 13 mini - 2023-05-08 at 15 52 32 Simulator Screenshot - iPhone 13 mini - 2023-05-08 at 15 49 25

@cyndichin cyndichin marked this pull request as ready for review May 8, 2023 19:53
@cyndichin cyndichin requested a review from a team as a code owner May 8, 2023 19:53
@cyndichin cyndichin requested review from nzeltzer and CMasterson and removed request for a team May 8, 2023 19:53
Copy link
Contributor

@CMasterson CMasterson left a comment

Choose a reason for hiding this comment

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

We probably don't need to add any localization here.

DebugMenuRow(
title: featureFlag.rawValue,
detail: featureFlag.description,
value: Services.shared.featureFlagService.isAssigned(flag: featureFlag).description
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 didn't create a view model to inject these as I felt it was overhead for a debug menu, but happy to refactor if needed

@dskuza
Copy link
Contributor

dskuza commented May 8, 2023

The only other real comment I have is that we're utilizing the Services.shared singleton within a view, rather than passing down any dependencies in as a dependency, but this is a debug view and I don't think that's something to think too hard about. Just pointing it out.

@pocket-ci
Copy link
Contributor

Messages
📖 No SwiftLint violations! 🎉
📖 Project coverage: 76.62%
📖 Checking XCode Environment Variables
📖 Edited 4 files
📖 Created 1 files

PocketKit: Coverage: 76.8

File Coverage
SettingsView.swift 73.61%
MainViewModel.swift 84.75%
AccountViewModel.swift 55.1%
DebugMenuView.swift 0.0% ⚠️
FeatureFlagService.swift 34.21% ⚠️

Generated by 🚫 Danger Swift against a4847a2

@cyndichin
Copy link
Contributor Author

We probably don't need to add any localization here.

Yup, I didn't add it due to it being the debug menu, thanks for considering this tho!

@cyndichin
Copy link
Contributor Author

The only other real comment I have is that we're utilizing the Services.shared singleton within a view, rather than passing down any dependencies in as a dependency, but this is a debug view and I don't think that's something to think too hard about. Just pointing it out.

good point! Thought it might add overhead so didn't add a view model or inject the dependencies. thanks!

@cyndichin cyndichin enabled auto-merge (rebase) May 8, 2023 20:26
@cyndichin cyndichin merged commit 09a5128 into develop May 8, 2023
@cyndichin cyndichin deleted the feat/debug-menu branch May 8, 2023 20:40
@bassrock
Copy link
Contributor

bassrock commented May 9, 2023

@dskuza imagine one of many possible futures when we get to SwiftUI we could set all the services as environment variables if we wanted and just yoink them out 😬

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants