Repository navigation
Library: a gift button right of the back arrow, as in Arc, opens Share Cra with a Friend - #1099
Conversation
…hare Cra with a Friend Arc's Library has a gift button at its foot, right of the back arrow, that opens "Share Arc with a friend". Cra's had the arrow alone, and its Share Cra with a Friend sheet only on Settings' first tab. The button is now there, 32×32 pt at x 73 on the arrow's row (Arc 1.170's AX frame: the arrow's place mirrored against the 113 pt rail), drawn as the arrow is: the gift symbol at 15 pt in the sidebar's glyph tone, the same hover fill, and the tip "Share Cra with a friend", the sheet's own title. CraCore LibraryRailTile.backFrame and giftFrame place both. Arc had it, so no setting gates it, and an incognito window's Library has it too. The click opens the sheet Settings opens, on the browser window, with the Library left open under it (MainWindowController.showShareCra, through DialogPanel like the other sheets AppKit hangs on a window; a sheet already up keeps it from opening). SwiftUI's dismiss closes only what SwiftUI presented, so ShareCraSheet takes an optional close, which its × and Escape call; Settings passes none, and its sheet is as before. Tests: LibraryRailIconsTests.theGiftButtonSitsRightOfTheBackArrowAsArcs (with the gift beside the arrow at x 48 it fails on x 73 and on the 8 pt to the rail's edge); scenario library-gift (the button's glyph, tip and place by the arrow's, the sheet on the window, no second one while it is up, none after endSheets, the Library still open). cra://debug adds libraryGift.
Confidence Score: 4/5
[Low impact] The new sharing route is limited to the Library and its browser window. The PR appears safe to merge, with a non-blocking gap in the dismissal test. Findings
SummaryAdds a gift button beside the Library’s back arrow and opens the existing sharing sheet on that browser window.
tonibiocic explicitly acknowledged the existing truncated sheet text and deferred its fix to #1098. It is not reported here. Build, runtime, and visual checks were not run in this Linux environment. Reviews (1) · Last reviewed commit: "The Library's gift button, right of its ..." · Reviewed by Greptile |
| # Closed as Escape would: the window has no sheet again, and the Library is still there. | ||
| cra://debug?endSheets=1 |
There was a problem hiding this comment.
Dismissal test skips user action
endSheets=1 calls endSheet directly, bypassing the new ShareCraSheet.close callback. This scenario would still pass if the sheet’s × button or Escape stopped closing it. Exercise the close button or Escape, then keep the checks that the sheet is gone and the Library remains open.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
|
Thanks, @tonibiocic! The gift button is on main as 083d5d2, merged after #1098, and will be in the next release. On the merge with main (#1098's ticket fix, the .74 engine and #1074), |
|
Shipped in Cra 0.1.62: https://github.com/VictorKildahl/cra/releases/tag/v0.1.62. Thank you @tonibiocic! |
Cra's Library gets Arc's gift button at its foot, right of the back arrow. A click on it opens Share Cra with a Friend on the browser window, and the Library stays open under the sheet. People who come from Arc find the button where Arc had it, and nobody has to go to Settings to share Cra any more.
What and why
In Arc, the gift button sits right of the back arrow at the Library's foot and opens "Share Arc with a friend". On main, Cra's Library has the back arrow alone, and Share Cra with a Friend opens only from Settings' first tab. No issue exists for it. This PR goes out together with #1098, which fixes the text of the sheet that the gift button opens. The two PRs are separate on purpose, so you can take one without the other: the gift button works with main's sheet, and the Share text fix works without the button. This branch does not hold that fix, so the picture of the sheet below shows its message and its link cut with "…", as main draws them.
git merge-treemerges the two branches without a conflict. Both changeAppDelegate.swiftandMemberCardView.swift, in different places, so the two can merge in either order.docs/arc-reverse-engineering.md already has Arc 1.170's Library foot, from its accessibility tree: the back arrow is 32 × 32 pt at x 8, 8 pt above the bottom, and the gift button is at x 73. Cra gives the gift button the arrow's size and the arrow's row. So the gift button is 8 pt in from the right edge of the 113 pt rail, as the arrow is 8 pt in from its left edge: 113 − 8 − 32 = 73.
With this PR:
giftat 15 pt, drawn as the back arrow is: aSidebarGlyphButtonwith the arrow's size, weight, colours and hover fill. Its tooltip is "Share Cra with a friend", the title of the sheet. I did not check Arc's tooltip.MainWindowController.showShareCra()puts the sheet there throughDialogPanel.present, as the other sheets that AppKit hangs on a window. When the window already has a sheet, the click opens nothing.dismisscloses only what SwiftUI presented. SoShareCraSheettakes an optionalclose, which its × button and Escape call. Settings passes none, and its sheet works as before.utm_campaign=share, and no account or server counts the shares.LibraryRailTile.backFrameandLibraryRailTile.giftFramein CraCore place the two buttons. docs/arc-parity.md and docs/arc-reverse-engineering.md name the gift button.How I tested it
The branch is one commit, f96d2e4, on upstream main at 1d93d47. I rebased it onto 1d93d47 on 2026-12-02. Every result below ran on f96d2e4. The one exception is the picture of the Library's foot at the top, a cut of a window that I took on 42a3416a, the same change on the older main 60d19dd.
git patch-idgives both commits the same id.LibraryRailIconsTests.theGiftButtonSitsRightOfTheBackArrowAsArcsin CraCore, 1 new test. It checks the back arrow at x 8 and the gift button at x 73, both 32 × 32 pt and 8 pt above the bottom. In a short window, the row moves with the bottom, the gift button stays clear of the arrow, and it stays 8 pt in from the rail's right edge. Result:✔ Test theGiftButtonSitsRightOfTheBackArrowAsArcs() passed.library-gift, through a new hook,cra://debug?libraryGift=1, which presses the gift button as a click does. It opens the Library and checks the gift button's glyph, tooltip and place beside the back arrow. Then it checks that the sheet opens on the window, and that a second press while the sheet is up opens no second sheet. After the sheet closes, the window has no sheet, and the Library is still open. Result:library-gift: passed, on its first run, in a test copy behind other apps. Its log haslibrary gift: pressed gift "Share Cra with a friend" at 73,840 32x32, back arrow at 8,840 32x32.scripts/lint.py:lint: clean (29 grandfathered findings).scripts/test.sh core: CraCore runs 3300 tests in 566 suites, and 1 fails:AppIconGridTests.theTilesAreTheIconsAsMacOSDrawsThem(feat: new native designs for all icons #935). AtAppIconGridTests.swift:87,scripts/render-icon-as-macos.shexits 1 on my Mac, so the test has no picture to compare. This PR does not touch the app icon. The other 16 steps oftest.sh corepass, and the run ends inFailed: CraCore.scripts/promises.py:promises: 2425 tests pinned for 583 issues and 33 crash fixes and 22 web features, unchanged. No issue exists, so this PR locks no test.scripts/build.shbuildsbuild/Cra.appfrom this commit.scripts/test.sh: of its 80 steps, only CraCore fails, with the same icon test as its one failure. Its Lint step printslint: clean (29 grandfathered findings), and the run ends inFailed: CraCore.