-
Notifications
You must be signed in to change notification settings - Fork 385
Adds options to remove bookmark #696
Changes from 2 commits
784d77e
65e96ea
69c2c84
a099969
678e2bf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,5 +42,6 @@ enum Constants { | |
static let inbox = NSLocalizedString("Inbox", comment: "") | ||
static let upload = NSLocalizedString("Upload", comment: "") | ||
static let bookmark = NSLocalizedString("Bookmark", comment: "") | ||
static let removeBookmark = NSLocalizedString("Remove Bookmark", comment: "") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this used anywhere else? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nope. I just don't like to have random string in AlertActions There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Although I get it, I think it would be more in line to keep single-use strings "hardcoded" as to not clutter the Constants even more. @rnystrom? |
||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,4 +56,12 @@ final class BookmarkStoreTests: XCTestCase { | |
|
||
XCTAssert(BookmarksStore.shared.bookmarks.count == 0) | ||
} | ||
|
||
func test_containsBookmark() { | ||
let b1 = BookmarkModel(type: .repo, name: "GitHawk", owner: "rizwankce") | ||
|
||
BookmarksStore.shared.add(bookmark: b1) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Gotta get rid of this singleton 😉 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes Yes. I just don't want to give a big PR with all changes. Wanted to give a separate/small PR after I fix the initial round of bug fixes. So it would be easy for us to review/conflicts free PR. |
||
|
||
XCTAssert(BookmarksStore.shared.contains(bookmark: b1)) | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually can we just make this
.default
? Seeing the destructive "red" next to other actions like "Close" and "Lock" is a little weird b/c this doesn't carry nearly the same weight. cc @BasThomas for thoughtsThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would make sense, but I think we’d like to move the action away from lock/close. Also, both Bookmark and Remove Bookmark have “side effects”, so (as we’re using it right now) both actions should be “destructive”.
I feel like it’s time to explore something completely different than the (now very long) action sheets...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Remove bookmark" does not carry the same weight as other destructive buttons. But IMO it would avoid accidentally tapping.
From Apple doc
Also, I do agree with @BasThomas. Action sheet is very long now. After 1.12.0 we should rethink and adopt a better way to handle this action sheet for sure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about moving the action (more) to the bottom? I think it doesn't make sense that it is next (and in this case even above) some probably more used, destructive actions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the discussion regarding "destructive": #532
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean "Remove bookmark" action to the bottom of the action sheet?
Yes, I'm down with that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, the add + remove bookmark :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved bookmark actions to bottom of the action sheet. 👍