| 1 | # Native composer polish |
| 2 | |
| 3 | Branch: `native/composer`, based on main `c74fd0ac`. |
| 4 | |
| 5 | ## Reference and changes |
| 6 | |
| 7 | Read Base's `origin/main:native/apple/Sources/BaseKit/Ask/Composer.swift` |
| 8 | and `origin/main:native/apple/Sources/BaseKit/Phone/PhoneAskScreen.swift` |
| 9 | with `git show`. The composer uses the screen background, a tinted field |
| 10 | with a 10-point corner and a focus edge in Equipo's accent. No new copy. |
| 11 | |
| 12 | Conversation, task detail (including its thread), and Needs you (which can |
| 13 | contain a reply field) dismiss the keyboard interactively. The attachment |
| 14 | menu is a separate round 44-point target to the field's left, with thumbnails |
| 15 | above. Photos continues to present from the picker owner outside the Menu. |
| 16 | Mac keeps paste and drop and adds a file panel via the same round add button. |
| 17 | |
| 18 | ## Verification |
| 19 | |
| 20 | Test-first: `swift test --package-path native/apple --filter ComposerPolishTests` |
| 21 | failed on the original production code: three missing scroll-dismissal |
| 22 | modifiers and no separate Mac attachment button. There is no ViewInspector |
| 23 | in this package; source contracts follow ProjectsReviewTests. Actual phone |
| 24 | dragging, menu and Photos presentation are exercised by AttachmentSourceUITests. |
| 25 | |
| 26 | Results, mutation commands, screenshot manifest and final gates follow below. |
| 27 | |
| 28 | Mutation command for each: `swift test --package-path native/apple --filter ComposerPolishTests`. |
| 29 | All six compiled and were killed by assertions, then restored: |
| 30 | |
| 31 | 1. Conversation `.interactively` replaced with `.never`. |
| 32 | 2. Task detail `.interactively` replaced with `.never`. |
| 33 | 3. Needs you `.interactively` replaced with `.never`. |
| 34 | 4. Mac attachment button moved inside the field view. |
| 35 | 5. Mac attachment target reduced from 44 to 32 points. |
| 36 | 6. Mac field's 52-point attachment offset removed (overlap). |
| 37 | |
| 38 | Simulator baseline: `xcodebuild -project native/ios/EquipoPhone.xcodeproj |
| 39 | -scheme AttachmentSources -configuration Debug -destination |
| 40 | 'platform=iOS Simulator,id=9B363AD0-4B74-46BD-AEEC-24241419BF65' |
| 41 | -derivedDataPath native/build/Phone -resultBundlePath "$TMPDIR/composer-before-fixed.xcresult" |
| 42 | CODE_SIGNING_ALLOWED=NO test`. |
| 43 | The original production code failed `testConversationDragDismissesKeyboard` |
| 44 | at the keyboard-disappeared assertion; the appearance and Photos-menu tests |
| 45 | passed. The fixture uses production ConversationScreen with a fake transport. |
| 46 | An initial harness attempt used `textViews`; the current simulator exposes |
| 47 | SwiftUI's vertical field as `textFields`, so the query was corrected before |
| 48 | collecting the baseline. No production workaround was needed. |
| 49 | |
| 50 | The definitive simulator regression uses a swipe beginning on a rendered |
| 51 | message. It passed with interactive dismissal, and replacing it with `.never` |
| 52 | failed at the keyboard-disappeared assertion (`composer-ui-mutation.xcresult`). |
| 53 | This is the seventh killed mutation, in addition to the six native checks. |
| 54 | The modifier lives on the containing screen, as in Base, covering the scroll |
| 55 | and the composer in its bottom inset. The test also verifies the typed draft |
| 56 | survives dismissal. |
| 57 | |
| 58 | An isolated AppKit probe clicked the real add button, observed its file panel, |
| 59 | and cancelled without changing the draft. Presenting a modal panel in the |
| 60 | concurrent full test process caused an early clean process exit, so the gate |
| 61 | tests the production panel factory without presenting it: files allowed, |
| 62 | directories excluded and multiple selection allowed. The existing paste/drop |
| 63 | tests also run in the native gate. |
| 64 | |
| 65 | The extra empty-padding gesture initially queried `app.scrollViews.firstMatch`, |
| 66 | which is ambiguous while the keyboard's prediction scroller is present. A |
| 67 | stable `conversation-scroll` identifier fixes that test target. Both the message |
| 68 | swipe and padding swipe pass (`composer-scroller-id.xcresult`); no gesture |
| 69 | workaround or content-shape change is shipped. Temporary runtime diagnostics |
| 70 | confirmed the UIKit scroller had interactive dismissal and vertical bouncing, |
| 71 | and were removed. |
| 72 | |
| 73 | Three further panel mutations also compiled and failed assertions using the |
| 74 | same filtered test command: files disabled, folders enabled, and multiple |
| 75 | selection disabled. All ten mutations were restored; the filtered suite |
| 76 | passes again. |
| 77 | |
| 78 | Final native gate: `native/scripts/check-native.sh` passed: 346 tests in 46 |
| 79 | suites (one existing known issue), 330 parity strings, schema/markdown checks, |
| 80 | reference scan, Mac build and iPhone Simulator build. No server changes. |
| 81 | |
| 82 | Screenshots are under `site/build/composer/` in the daily-driver audit: |
| 83 | `iphone-{before,after}-{light,dark}-keyboard-{up,down}.png`, |
| 84 | `mac-{before,after}-{light,dark}.png`, and menu/Photos-picker captures. |
| 85 | They are actual simulator/AppKit captures from production views with the |
| 86 | existing attachment fake server. No new strings or copy questions. |
| 87 | |
| 88 | Final simulator command is the same AttachmentSources invocation above with |
| 89 | `-resultBundlePath "$TMPDIR/composer-final.xcresult"`. All three UI tests passed: |
| 90 | light/dark captures, message and padding dismissal with draft preservation, |
| 91 | and the 44-point attachment menu opening the private Photos picker. |
| 92 | |