Skip to content

fix: resolve circular references & Conjugate target compilation errors#634

Open
prince-0408 wants to merge 7 commits intoscribe-org:mainfrom
prince-0408:fix-issue-627-download-data-empty-state
Open

fix: resolve circular references & Conjugate target compilation errors#634
prince-0408 wants to merge 7 commits intoscribe-org:mainfrom
prince-0408:fix-issue-627-download-data-empty-state

Conversation

@prince-0408
Copy link
Copy Markdown
Contributor

Context

Addresses persistent compilation failures in the Conjugate build target and resolves circular reference issues that were blocking the build across multiple targets.

Changes

1. Resolved Circular References

Refactored NavigationLevel (NavigationStructure.swift) and DeclensionNode (DataContract.swift) from struct to class.

Symbol File Before After
NavigationLevel NavigationStructure.swift struct class
DeclensionNode DataContract.swift struct class

This resolves Codable synthesis failures and recursive value-type errors that were causing circular reference warnings on main.

2. Conjugate Target Restoration

Area Change
Membership Fixes Restored 60+ missing PBXBuildFile entries in project.pbxproj required for the Conjugate target
Synchronized Groups Properly configured DataManager and DataContracts synchronized groups for the Conjugate target
Exclusion Cleanup Removed incorrect build exclusions for DownloadButton.swift, CTAButton.swift, and ConfirmDialogView.swift
Dependency Alignment Linked the Yams framework and Swift Package to resolve the CYaml module resolution error

3. Entry Point Conflict

Removed AppDelegate.swift from the Conjugate target's sources to resolve the @main attribute conflict between the Scribe (UIKit) and Conjugate (SwiftUI) app entry points.

Verification

Scheme Result
Conjugate BUILD SUCCEEDED
Scribe BUILD SUCCEEDED

Related Issues

When a Scribe keyboard is installed but language data has not been
downloaded yet, a blue 'Please download language data' button now
appears at the top of the keyboard. Tapping it opens the Scribe app
and navigates directly to the Download Data screen.

Changes:
- KeyboardViewController.swift
  - Added downloadDataBtn (UIButton?) property
  - Added hasLanguageData() to check if the language SQLite file
    exists in the shared app group container
  - Added showDownloadDataBtn() to create and layout the blue CTA
    button at the top of the keyboard view
  - Added conditionallyShowDownloadDataBtn() to show/hide the button
    based on data availability and current command state (only shown
    in .idle state, hidden during translate/conjugate/plural/info)
  - Added openScribeApp() using the UIResponder chain to open the
    scribe:// URL scheme and direct the user to the download screen
  - Called conditionallyShowDownloadDataBtn() at the end of loadKeys()
  - Button is also hidden during displayInformation state

- CommandVariables.swift
  - Added downloadDataMsg variable with default English fallback text
    'Please download language data'

- Language interface variables (all 11 keyboards)
  - ENInterfaceVariables: 'Please download language data'
  - DEInterfaceVariables: 'Bitte Sprachdaten herunterladen'
  - FRInterfaceVariables: 'Veuillez télécharger les données linguistiques'
  - ESInterfaceVariables: 'Por favor descarga los datos del idioma'
  - ITInterfaceVariables: 'Scarica i dati della lingua'
  - PTInterfaceVariables: 'Por favor baixe os dados do idioma'
  - RUInterfaceVariables: 'Загрузите языковые данные'
  - SVInterfaceVariables: 'Ladda ner språkdata'
  - NBInterfaceVariables: 'Last ned språkdata'
  - HEInterfaceVariables: 'אנא הורד נתוני שפה'
  - IDInterfaceVariables: 'Unduh data bahasa'

- Scribe/Info.plist
  - Registered scribe:// URL scheme (CFBundleURLSchemes) so the app
    can be opened from the keyboard extension

- Scribe/AppDelegate.swift
  - Added application(_:open:options:) handler for the scribe:// URL
  - Posts NavigateToDownloadScreen notification which InstallationVC
    already handles to push the DownloadDataScreen

Closes scribe-org#627
@github-actions
Copy link
Copy Markdown

Thank you for the pull request! 💙🩵

The Scribe-iOS team will do our best to address your contribution as soon as we can. The following are some important points:

  • Those interested in developing their skills and expanding their role in the community should read the mentorship and growth section of the contribution guide
  • If you're not already a member of our public Matrix community, please consider joining!
    • We'd suggest that you use the Element client as well as Element X for a mobile app
    • Join the General and iOS rooms once you're in
  • Also consider attending our bi-weekly Saturday developer syncs!
    • Details are shared in the General room on Matrix each Wednesday before the sync
    • It would be great to meet you 😊

Note

Scribe uses Conventional Comments in reviews to make sure that communication is as clear as possible.

@github-actions
Copy link
Copy Markdown

Maintainer Checklist

The following is a checklist for maintainers to make sure this process goes as well as possible. Feel free to address the points below yourself in further commits if you realize that actions are needed :)

  • Tests for changes have been written and the CI unit test, linting and formatting workflows within the PR checks do not indicate new errors in the files changed

  • The CHANGELOG has been updated with a description of the changes for the upcoming release and the corresponding issue (if necessary)

@andrewtavis
Copy link
Copy Markdown
Member

Let us know when this is ready for review, @prince-0408 :)

@prince-0408
Copy link
Copy Markdown
Contributor Author

Hi @andrewtavis! The PR is ready for review. I've resolved the merge conflict in
project.pbxproj
and fixed the Conjugate target build errors caused by missing source file references that were dropped during the conflict resolution. The Scribe and Conjugate targets are both building successfully now. 🙂

@andrewtavis
Copy link
Copy Markdown
Member

Sounds good, @prince-0408! I'll check this out later. Feel free to continue to work on #633 and #626 😊

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.

Add button to top of keyboard directing user to download screen when no data is downloaded

2 participants