ios icon indicating copy to clipboard operation
ios copied to clipboard

Revamp Settings Section: Complete Migrating to Swift & SwiftUI

Open adityagi02 opened this issue 1 year ago • 1 comments

Overview

This pull request aims to overhaul the existing Settings section of the app, transitioning it from the old Objective-C code with XLForm package usage to modern Swift code utilizing SwiftUI. The revamp covers the Settings screen along with its connected components such as SettingsAdvanced Screen, AutoUpload Screen, ChangeAutoUploadFileName screen, and associated small views.

This significant refactoring enhances maintainability, optimises performance of app, improves user experience, and aligns with modern iOS development standards.

  • [x] Navigation between More & Settings Screens
  • [ ] Settings Screen
  • [ ] Advanced Screen
  • [ ] Navigation between More & Advanced Screens
  • [ ] AutoUpload Screen
  • [ ] Navigation between More & Settings Screens
  • [ ] ChangeAutoUploadFileName Screen
  • [ ] Navigation between AutoUpload & ChangeAutoUploadFileName Screens
  • [ ] Other bugs fixes in Settings Section

P.S.: I'll keep adding screenshots with every particular screen commit.

adityagi02 avatar Mar 02 '24 17:03 adityagi02

@marinofaggiana please keep on reviewing once you get time, as otherwise this will be a big chunk of code at last. I'll try to be punctual, except if I have university exams in between.

adityagi02 avatar Mar 02 '24 17:03 adityagi02

Hi @adityagi02 welcome !! I absolutely thank you for your great help, for any questions, reviews or anything else we are here for you. Out of curiosity, what university are you attending?

Note.

  • please use DCO for signed your push
  • compatibility with keychain get/put calls must be maintained
  • for everything else you are free to indulge yourself as you wish

Thanks a lot !

ping @mpivchev

marinofaggiana avatar Mar 03 '24 10:03 marinofaggiana

Thank you for the warm welcome! I love Nextcloud & I'm glad to be contributing here.💙

I'm currently enrolled at the Indian Institute of Information Technology. It's a privilege to be part of an institution that requires passing one of the toughest STEM exams in the world, the JEE Mains & Advanced, for admission.

I'll definitely keep the points you mentioned in mind.

Thanks again !!

adityagi02 avatar Mar 03 '24 15:03 adityagi02

New Settings Screen

ss

Some queries:

  • Firstly, In this Privacy Form, we have vaguely defined toggle text which is confusing. Either we have to change the content text or we have to add some proper footer explanation of what each toggles do.
  • When you click "Get Source Code", a browser sheet opens but it's UI is not proper, we have to follow a common and more descriptive view for this.✅ Screenshot 2024-03-04 at 9 40 36 AM Screenshot 2024-03-05 at 1 27 08 PM

Here user cannot Sign In as cancel button is overlapping. Corrected✅

adityagi02 avatar Mar 04 '24 04:03 adityagi02

Hi @adityagi02 some problem with OpenSSL ?

Screenshot 2024-03-05 alle 10 07 52

marinofaggiana avatar Mar 05 '24 09:03 marinofaggiana

Hi @adityagi02 some problem with OpenSSL ?

Screenshot 2024-03-05 alle 10 07 52

yeah, my Xcode which is causing some issue with fetching OpenSSL, so i kept a local dependency you can just add OpenSSL from manager and build with that it'll work fine.

adityagi02 avatar Mar 05 '24 09:03 adityagi02

Hi @adityagi02 some problem with OpenSSL ? Screenshot 2024-03-05 alle 10 07 52

yeah, my Xcode which is causing some issue with fetching OpenSSL, so i kept a local dependency you can just add OpenSSL from manager and build with that it'll work fine.

yes, sure, but is strange, it shouldn't happen

marinofaggiana avatar Mar 05 '24 09:03 marinofaggiana

Hi @adityagi02 some problem with OpenSSL ? Screenshot 2024-03-05 alle 10 07 52

yeah, my Xcode which is causing some issue with fetching OpenSSL, so i kept a local dependency you can just add OpenSSL from manager and build with that it'll work fine.

yes, sure, but is strange, it shouldn't happen

Yes, it can be an issue otherwise. I have 3 different XCode versions in my desktop for different tasks, maybe that has caused this, but i'll check for exact reason and update if possible.

My machine:

macOS Sonoma Version 14.3
XCode Version 15.0.1 

adityagi02 avatar Mar 05 '24 09:03 adityagi02

New AutoUpload Screen AUSR

Queries:

  • We have to rethink the arrangements of these sections, and reconsider these vaguely defined texts on them.

adityagi02 avatar Mar 06 '24 16:03 adityagi02

@adityagi02 thanks again for the work you are doing, remember that user switching also needs to be managed.

For example, you can be in the settings, push "Files" , change user and then push "More", at this point the setting must be reloaded otherwise it shows incorrect data (of the previous user).

marinofaggiana avatar Mar 06 '24 16:03 marinofaggiana

New Advanced Screen advanced

Changes:

  1. All picker menus are now new SwiftUI pickers and constant throughout Settings. Old:- IMG_4466 IMG_4467 New:-Screenshot 2024-03-08 at 11 48 36 AM Screenshot 2024-03-08 at 11 48 42 AM

  2. No need of any new View❌ IMG_4468

  3. I have made the trash image red, so that it highlights.(Just my idea)

Queries:

  1. We have same texts for two different sections, should we have some changes on these.

Screenshot 2024-03-08 at 11 30 02 AM Screenshot 2024-03-08 at 11 30 11 AM

@mpivchev

adityagi02 avatar Mar 08 '24 06:03 adityagi02

We were not having any confirmation alerts, when the user taps on clear log file section.

Added✅ Screenshot 2024-03-09 at 10 43 58 PM

adityagi02 avatar Mar 09 '24 16:03 adityagi02

Sorry for the DCO, i can't sort this out. I've tried commiting from terminal and XCode both, still It's not working.

adityagi02 avatar Mar 09 '24 17:03 adityagi02

Hi @adityagi02, thank you for this, it looks great so far :)

mpivchev avatar Mar 11 '24 09:03 mpivchev

Hey guys, sorry for that much time, i'm busy as anything with my college assignments along with my current internship. I've committed remaining changes, not tested completely so not pushing right now. Will be back here in second week. @marinofaggiana @mpivchev

adityagi02 avatar Mar 30 '24 15:03 adityagi02

Hey guys, sorry for that much time, i'm busy as anything with my college assignments along with my current internship. I've committed remaining changes, not tested completely so not pushing right now. Will be back here in second week. @marinofaggiana @mpivchev

Don't worry, school always comes first !

marinofaggiana avatar Apr 02 '24 09:04 marinofaggiana

Hey guys, sorry for that much time, i'm busy as anything with my college assignments along with my current internship. I've committed remaining changes, not tested completely so not pushing right now. Will be back here in second week. @marinofaggiana @mpivchev

Don't worry, school always comes first !

If you have some free time today or tomorrow, could you please address the doubts mentioned in the review comments above?

adityagi02 avatar Apr 04 '24 14:04 adityagi02

Hey guys, sorry for that much time, i'm busy as anything with my college assignments along with my current internship. I've committed remaining changes, not tested completely so not pushing right now. Will be back here in second week. @marinofaggiana @mpivchev

Don't worry, school always comes first !

If you have some free time today or tomorrow, could you please address the doubts mentioned in the review comments above?

mm where can you report the doubts thx

marinofaggiana avatar Apr 06 '24 07:04 marinofaggiana

Hi, I have completed all the tasks, you can start final review. There is a small merge conflict, will resolve it afterwards.

@marinofaggiana @mpivchev

adityagi02 avatar Apr 07 '24 06:04 adityagi02

  • maybe a font more small (15 pt)

  • In Settings: Lock: On (? is off, which passcode)

  • In Advanced/Capabilities the view title is absent (look End-to-end encryption view)

More space at bottom fore read the content and also in Advanced

Screenshot 2024-04-08 alle 14 03 37

(for now stop)

sure!! Is that all?

adityagi02 avatar Apr 09 '24 09:04 adityagi02

  • maybe a font more small (15 pt)
  • In Settings: Lock: On (? is off, which passcode)
  • In Advanced/Capabilities the view title is absent (look End-to-end encryption view)

More space at bottom fore read the content and also in Advanced Screenshot 2024-04-08 alle 14 03 37 (for now stop)

sure!! Is that all?

hope yes :D .. and please fix the packages + conflicts

marinofaggiana avatar Apr 10 '24 06:04 marinofaggiana

Hey @marinofaggiana, Can you direct me to a right direction regarding Lock On/Off as i'm stuck on it? Whenever I'm working on it, there are some blockers in connecting this old style TOPasscodeController package code with SwiftUI. The earlier NCSettings' code is more compatible with this package due to being written in Objective-C.

adityagi02 avatar Apr 10 '24 18:04 adityagi02

Don't worry, I can make I, It's a little complicated to explain, you can complete the other issue

marinofaggiana avatar Apr 11 '24 08:04 marinofaggiana

Hi ! please Rebase (we have implemented the UIScene)

marinofaggiana avatar Apr 11 '24 13:04 marinofaggiana

not building currently inside AutoUploadView !!

Screenshot 2024-04-12 at 9 43 06 AM

adityagi02 avatar Apr 12 '24 04:04 adityagi02

not building currently inside AutoUploadView !!

Screenshot 2024-04-12 at 9 43 06 AM

can I fix in your code ?

marinofaggiana avatar Apr 12 '24 10:04 marinofaggiana

not building currently inside AutoUploadView !!

Screenshot 2024-04-12 at 9 43 06 AM
  • Rebase from Develop
  • you can get the serverUrl

let serverUrl = NCUtilityFileSystem().getHomeServer(urlBase: appDelegate.urlBase, userId: appDelegate.userId) you can put it where you want.

so your code will be:

SelectView(serverUrl: serverUrl) or viewModel.serverUrl (if you have put the code in viewModel) .onDisappear { viewModel.setAutoUploadDirectory(serverUrl: serverUrl) }

adityagi02 avatar Apr 12 '24 11:04 adityagi02

Don't worry, I can make I, It's a little complicated to explain, you can complete the other issue

is this done, so that we can proceed to merge.

adityagi02 avatar Apr 15 '24 11:04 adityagi02

Don't worry, I can make I, It's a little complicated to explain, you can complete the other issue

is this done, so that we can proceed to merge.

Hi @adityagi02 thanks for your job, only some consideration:

  • private let manageDatabase = NCManageDatabase() Why init a new DB instance and not use the share instance ?

  • NCSettings line 130: every time I change something reload NCViewE2EE(account: AppDelegate().account, rootViewController: nil) which in turn tests the GET API https://nextcloud.homelinux.org/ocs/v2.php/apps/end_to_end_encryption/api/v1/public-key , this is not good, network access or API calls should only be used when required (therefore be careful when using the ObservedObject)

  • can you use the Lint ?

@mpivchev It would be nice if I could help you too

marinofaggiana avatar Apr 15 '24 15:04 marinofaggiana

Don't worry, I can make I, It's a little complicated to explain, you can complete the other issue

is this done, so that we can proceed to merge.

Hi @adityagi02 thanks for your job, only some consideration:

  • private let manageDatabase = NCManageDatabase() Why init a new DB instance and not use the share instance ?
  • NCSettings line 130: every time I change something reload NCViewE2EE(account: AppDelegate().account, rootViewController: nil) which in turn tests the GET API https://nextcloud.homelinux.org/ocs/v2.php/apps/end_to_end_encryption/api/v1/public-key , this is not good, network access or API calls should only be used when required (therefore be careful when using the ObservedObject)
  • can you use the Lint ?

@mpivchev It would be nice if I could help you too

Hey, thanks for these points. I got some idea, but still i think i'll need some help, so @mpivchev can we have a small meet around some time tomorrow, so that i can resolve some silly doubts i had. Thank you again @marinofaggiana

adityagi02 avatar Apr 15 '24 15:04 adityagi02