fix(qlpreview): hide share-arrow in expired state (gitea#7 review)
Android UI Tests / ui-tests (pull_request) Has been cancelled
Android UI Tests / ui-tests (pull_request) Has been cancelled
The down-chevron above the system Share button is a "tap here" cue for the active flow. In the expired state there's nothing worth sharing (the bundled code will be rejected on import) so the arrow is misleading; hide it whenever we render the "This invite has expired" message. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -288,8 +288,14 @@ class PreviewViewController: UIViewController, QLPreviewingController {
|
|||||||
let expiredAgo = Self.expiredRelativePhraseOrNil(residence.expiresAt)
|
let expiredAgo = Self.expiredRelativePhraseOrNil(residence.expiresAt)
|
||||||
if let expiredAgo {
|
if let expiredAgo {
|
||||||
instructionLabel.attributedText = Self.makeExpiredInstructions(sharedBy: residence.sharedBy)
|
instructionLabel.attributedText = Self.makeExpiredInstructions(sharedBy: residence.sharedBy)
|
||||||
|
// The down-chevron points at the Share button as a visual
|
||||||
|
// cue to tap it; in the expired state there's nothing
|
||||||
|
// useful to share (the server will reject the bundled
|
||||||
|
// code) so the arrow becomes misleading. Hide it.
|
||||||
|
arrowImageView.isHidden = true
|
||||||
} else {
|
} else {
|
||||||
instructionLabel.attributedText = Self.makeResidenceInstructions()
|
instructionLabel.attributedText = Self.makeResidenceInstructions()
|
||||||
|
arrowImageView.isHidden = false
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clear existing details
|
// Clear existing details
|
||||||
|
|||||||
@@ -277,11 +277,15 @@ private final class MockPreviewViewController: UIViewController {
|
|||||||
switch state {
|
switch state {
|
||||||
case .active:
|
case .active:
|
||||||
instructionLabel.attributedText = makeResidenceInstructions()
|
instructionLabel.attributedText = makeResidenceInstructions()
|
||||||
|
arrowImageView.isHidden = false
|
||||||
if let expiresAt = residence.expiresAt, !expiresAt.isEmpty {
|
if let expiresAt = residence.expiresAt, !expiresAt.isEmpty {
|
||||||
addDetailRow(icon: "clock", text: "Expires \(formatActiveExpiry(expiresAt))")
|
addDetailRow(icon: "clock", text: "Expires \(formatActiveExpiry(expiresAt))")
|
||||||
}
|
}
|
||||||
case .expired(let elapsed):
|
case .expired(let elapsed):
|
||||||
instructionLabel.attributedText = makeExpiredInstructions(sharedBy: residence.sharedBy)
|
instructionLabel.attributedText = makeExpiredInstructions(sharedBy: residence.sharedBy)
|
||||||
|
// Arrow points at the Share button — no point telling the
|
||||||
|
// user to tap it for a dead link. Matches PreviewViewController.
|
||||||
|
arrowImageView.isHidden = true
|
||||||
addDetailRow(icon: "clock", text: "Expired \(relativePhrase(secondsAgo: elapsed))")
|
addDetailRow(icon: "clock", text: "Expired \(relativePhrase(secondsAgo: elapsed))")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
BIN
Binary file not shown.
|
Before Width: | Height: | Size: 128 KiB After Width: | Height: | Size: 128 KiB |
Reference in New Issue
Block a user