Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
bb68cbb
refactor: remove old form elements
catreedle Feb 27, 2026
ea4b161
feat: set information tooltip to use dynamic form
catreedle Feb 27, 2026
6a90440
remove left and right button components from Keyboard.xib and controller
catreedle Mar 2, 2026
a6cb9d5
delete unused Tooltip files
catreedle Mar 2, 2026
c0a6ff5
fix title display command
catreedle Mar 2, 2026
1a6ccde
Update Scribe-i18n
andrewtavis Mar 5, 2026
2aee4d2
add invalid message for invalid translation
catreedle Mar 5, 2026
706ac74
add invalid information texts for invalid translation
catreedle Mar 5, 2026
377e14f
add language extensions target for Localizable.xcstrings
catreedle Mar 5, 2026
840c69d
Merge branch 'scribe-org:main' into info-form
catreedle Mar 6, 2026
8acb6ae
Switch project over to using prek and update Scribe-i18n
andrewtavis Mar 13, 2026
83d88ae
Add mentorship and growth to contriburing and fix toc navigation
andrewtavis Mar 13, 2026
d54037f
Fix broken contributing link
andrewtavis Mar 14, 2026
2f17265
add info tooltip invalid command translations #597
catreedle Mar 17, 2026
e81fbdd
Fix/not in wiktionary (#605)
shabicha Mar 20, 2026
3976451
Use Swift UI for the Conjugate App (#604)
angrezichatterbox Mar 21, 2026
4ed6ca0
add invalid message for invalid translation
catreedle Mar 5, 2026
50f7023
add invalid information texts for invalid translation
catreedle Mar 5, 2026
4c90352
add info tooltip invalid command translations #597
catreedle Mar 17, 2026
1323985
Merge branch 'main' into info-form
catreedle Mar 24, 2026
e883409
fix merge conflict variables
catreedle Mar 24, 2026
c369978
fix merge conflict variables
catreedle Mar 24, 2026
b1f02c2
Merge branch 'main' into info-form
andrewtavis Mar 24, 2026
d2be7ff
Merge branch 'main' into info-form
catreedle Mar 24, 2026
054c118
Merge branch 'main' into info-form
andrewtavis Mar 24, 2026
62a8e9d
feat: improve animation for check for new data #598 (#624)
prince-0408 Mar 24, 2026
80b5bc1
Convert project over to using Swift standard of four spaces and forma…
andrewtavis Mar 24, 2026
af3a380
Order imports
andrewtavis Mar 24, 2026
11924e1
Update repo workflows
andrewtavis Mar 24, 2026
55591cb
Minor workflow update
andrewtavis Mar 25, 2026
ddb14de
refactor: remove old form elements
catreedle Feb 27, 2026
f7125ab
remove left and right button components from Keyboard.xib and controller
catreedle Mar 2, 2026
16e5f66
delete unused Tooltip files
catreedle Mar 2, 2026
077d4be
Merge remote-tracking branch 'origin/main' into info-form
catreedle Mar 25, 2026
43d9295
remove unused func createInformationStateDatasource
catreedle Mar 25, 2026
ee7f22d
fix build error after InformationToolTip merge conflict
catreedle Mar 25, 2026
03602f5
fix swiftlint error
catreedle Mar 25, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
143 changes: 85 additions & 58 deletions Keyboards/KeyboardsBase/DynamicConjugationViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,14 @@
import UIKit

class DynamicConjugationViewController: UIViewController {
// MARK: UI Components
var isInfoState: Bool = false

// MARK: UI Components

private var leftArrowButton: UIButton!
private var rightArrowButton: UIButton!
private var buttonContainerView: UIView!
private var pageControl: UIPageControl?

// MARK: Navigation Data

Expand Down Expand Up @@ -55,7 +58,8 @@ class DynamicConjugationViewController: UIViewController {
super.viewDidLoad()
view.backgroundColor = keyboardBgColor
setupUI()
}
setupPageControl()
}

override func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()
Expand Down Expand Up @@ -120,6 +124,26 @@ class DynamicConjugationViewController: UIViewController {
),
buttonContainerView.bottomAnchor.constraint(equalTo: view.bottomAnchor, constant: -8)
])
}

/// Builds page control for linear navigation mode.
private func setupPageControl() {
guard isInfoState, let cases = linearCases else { return }

let pc = UIPageControl()
pc.numberOfPages = cases.count
pc.currentPage = currentCaseIndex
pc.pageIndicatorTintColor = keyCharColor.withAlphaComponent(0.3)
pc.currentPageIndicatorTintColor = keyCharColor
pc.translatesAutoresizingMaskIntoConstraints = false
view.addSubview(pc)

NSLayoutConstraint.activate([
pc.centerXAnchor.constraint(equalTo: view.centerXAnchor),
pc.bottomAnchor.constraint(equalTo: view.bottomAnchor, constant: -12)
])

self.pageControl = pc
}

// MARK: Display
Expand All @@ -138,11 +162,7 @@ class DynamicConjugationViewController: UIViewController {
commandBar?.isShowingInfoButton = false

let options = currentLevel.options
guard !options.isEmpty
else {
commandBar?.text = commandPromptSpacing + "No options available"
return
}
guard !options.isEmpty else { return }

// Create button grid.
let count = options.count
Expand Down Expand Up @@ -173,21 +193,24 @@ class DynamicConjugationViewController: UIViewController {
height: buttonHeight
)

button.setTitleColor(keyCharColor, for: .normal)
button.backgroundColor = keyColor
button.titleLabel?.font = .systemFont(ofSize: 16)
button.titleLabel?.numberOfLines = 0
button.titleLabel?.adjustsFontSizeToFitWidth = true
button.titleLabel?.minimumScaleFactor = 0.6
button.titleLabel?.textAlignment = .center
button.contentVerticalAlignment = .center
button.layer.cornerRadius = keyCornerRadius
button.layer.shadowColor = keyShadowColor
button.layer.shadowOffset = CGSize(width: 0, height: 1)
button.layer.shadowOpacity = 1.0
button.layer.shadowRadius = 0
button.tag = index
button.addTarget(self, action: #selector(optionButtonTapped(_:)), for: .touchUpInside)
button.setTitleColor(keyCharColor, for: .normal)
button.backgroundColor = keyColor
button.titleLabel?.font = .systemFont(ofSize: 16)
button.titleLabel?.numberOfLines = 0
button.titleLabel?.adjustsFontSizeToFitWidth = true
button.titleLabel?.minimumScaleFactor = 0.6
button.titleLabel?.textAlignment = .center
button.contentVerticalAlignment = .center
button.layer.cornerRadius = keyCornerRadius
button.layer.shadowColor = keyShadowColor
button.layer.shadowOffset = CGSize(width: 0, height: 1)
button.layer.shadowOpacity = 1.0
button.layer.shadowRadius = 0
button.tag = index
button.addTarget(self, action: #selector(optionButtonTapped(_:)), for: .touchUpInside)
if isInfoState {
button.contentEdgeInsets = UIEdgeInsets(top: 8, left: 12, bottom: 8, right: 12)
}

// Determine the display value.
let displayValue: String?
Expand Down Expand Up @@ -240,52 +263,56 @@ class DynamicConjugationViewController: UIViewController {

case let .finalValue(value):
// Skip empty values.
guard !value.isEmpty else { return }
guard !value.isEmpty, !isInfoState else { return }

// Insert text and close.
proxy.insertText(value + " ")
closeTapped()
}
}

/// Handles left arrow button tap.
@objc private func leftArrowTapped() {
if let cases = linearCases {
// Linear mode: navigate between cases or go back in tree.
if navigationStack.count > 1 {
// In a variant - go back.
navigationStack.removeLast()
displayCurrentLevel()
} else if currentCaseIndex > 0 {
// At root level - go to previous case.
currentCaseIndex -= 1
navigationStack = [cases[currentCaseIndex]]
displayCurrentLevel()
}
} else {
// Tree mode: just go back.
if navigationStack.count > 1 {
navigationStack.removeLast()
displayCurrentLevel()
/// Handles left arrow button tap.
@objc private func leftArrowTapped() {
if let cases = linearCases {
// Linear mode: navigate between cases or go back in tree.
if navigationStack.count > 1 {
// In a variant - go back.
navigationStack.removeLast()
displayCurrentLevel()
} else if currentCaseIndex > 0 {
// At root level - go to previous case.
currentCaseIndex -= 1
navigationStack = [cases[currentCaseIndex]]
displayCurrentLevel()
}
} else {
// Tree mode: just go back.
if navigationStack.count > 1 {
navigationStack.removeLast()
displayCurrentLevel()
}
}
}
}

/// Handles right arrow button tap.
@objc private func rightArrowTapped() {
if let cases = linearCases {
// Linear mode: navigate to next case.
if navigationStack.count > 1 {
// In a variant - can't navigate cases.
return
} else if currentCaseIndex < cases.count - 1 {
// At root level - go to next case.
currentCaseIndex += 1
navigationStack = [cases[currentCaseIndex]]
displayCurrentLevel()
pageControl?.currentPage = currentCaseIndex
}

/// Handles right arrow button tap.
@objc private func rightArrowTapped() {
if let cases = linearCases {
// Linear mode: navigate to next case.
if navigationStack.count > 1 {
// In a variant - can't navigate cases.
return
} else if currentCaseIndex < cases.count - 1 {
// At root level - go to next case.
currentCaseIndex += 1
navigationStack = [cases[currentCaseIndex]]
displayCurrentLevel()
}
}
}
// Tree mode: right arrow does nothing.
// Tree mode: right arrow does nothing.

pageControl?.currentPage = currentCaseIndex
}

/// Updates the enabled state of arrow buttons.
Expand Down
1 change: 1 addition & 0 deletions Keyboards/KeyboardsBase/InterfaceVariables.swift
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ enum ConjViewShiftButtonsState {
var keyboardState: KeyboardState = .letters
var shiftButtonState: ShiftButtonState = .normal
var commandState: CommandState = .idle
var prevToInvalidState: CommandState = .idle
var autoActionState: AutoActionState = .suggest
var conjViewShiftButtonsState: ConjViewShiftButtonsState = .bothInactive
var pluralWords: Set<String>?
Expand Down
Loading
Loading