Skip to content

Commit

Permalink
Merge pull request #1269 from planetary-social/feature/message_view
Browse files Browse the repository at this point in the history
Sub-threads
  • Loading branch information
martindsq authored Jun 21, 2023
2 parents 85b13fe + d887983 commit 7f61003
Show file tree
Hide file tree
Showing 63 changed files with 1,819 additions and 343 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

- Redesigned screen that shows the detail of a message.
- Sub-threads: you can now reply to a reply.
- Add the option to reply to a reaction or a contact message (follow, unfollow, block).
- The Preview screen shows the message you are replying to (if so).

## [2.0.1] 2023-03-28

- Improved message replication performance.
- Redesigned screen for composing posts with better support for previewing.
- Filter list of followers/follows by name, bio or identity.

## [2.0.0] _waiting for review_
## [2.0.0] 2023-03-08

- Updated the localization strategy to have a better support of foreign languages. #1065
- Added the option to join the Planetary room to the Manage Rooms screen. #1137
Expand Down
53 changes: 46 additions & 7 deletions Planetary.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

9 changes: 7 additions & 2 deletions Planetary.xcodeproj/xcshareddata/xcschemes/Planetary.xcscheme
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1410"
version = "1.7">
version = "2.0">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
Expand Down Expand Up @@ -66,12 +66,17 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
disableMainThreadChecker = "YES"
disablePerformanceAntipatternChecker = "YES"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugXPCServices = "NO"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
allowLocationSimulation = "YES"
viewDebuggingEnabled = "No"
queueDebuggingEnabled = "No">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
Expand Down
12 changes: 6 additions & 6 deletions Resources/Assets.xcassets/icon-like.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"images" : [
{
"filename" : "icon-dark-like-1.png",
"filename" : "Like_default--light.png",
"idiom" : "universal",
"scale" : "1x"
},
Expand All @@ -12,12 +12,12 @@
"value" : "dark"
}
],
"filename" : "icon-dark-like.png",
"filename" : "Like_default--dark.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "icon-dark-like@2x-1.png",
"filename" : "Like_default--light@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
Expand All @@ -28,12 +28,12 @@
"value" : "dark"
}
],
"filename" : "icon-dark-like@2x.png",
"filename" : "Like_default--dark@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "icon-dark-like@3x-1.png",
"filename" : "Like_default--light@3x.png",
"idiom" : "universal",
"scale" : "3x"
},
Expand All @@ -44,7 +44,7 @@
"value" : "dark"
}
],
"filename" : "icon-dark-like@3x.png",
"filename" : "Like_default--dark@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
39 changes: 3 additions & 36 deletions Resources/Assets.xcassets/icon-liked.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -1,50 +1,17 @@
{
"images" : [
{
"filename" : "icon-dark-like-full-1.png",
"filename" : "Like_active.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"filename" : "icon-dark-like-full.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"filename" : "[email protected]",
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "3x"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"filename" : "[email protected]",
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "3x"
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "Not visible.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Not [email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Not [email protected]",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion Resources/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>417</string>
<string>418</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSRequiresIPhoneOS</key>
Expand Down
10 changes: 2 additions & 8 deletions Source/App/AppController+URL.swift
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,8 @@ extension AppController {
}

func pushThreadViewController(for identifier: MessageIdentifier) {
Bots.current.thread(rootKey: identifier) { (root, _, error) in
if let root = root {
let controller = ThreadViewController(with: root)
self.push(controller)
} else if let error = error {
self.alert(error: error)
}
}
let controller = MessageViewBuilder.build(identifier: identifier)
self.push(controller, animated: true)
}

func pushChannelViewController(for hashtag: String) {
Expand Down
7 changes: 6 additions & 1 deletion Source/Bot/Bot.swift
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,12 @@ protocol Bot: AnyObject, Sendable {
/// This is useful for showing all the posts from a particular
/// person, like in an About screen.
func feed(strategy: FeedStrategy, limit: Int, offset: Int?, completion: @escaping MessagesCompletion)


/// Fetches the message with the given Identigfier from the database.
func message(identifier: MessageIdentifier) async throws -> Message?

func likes(identifier: MessageIdentifier, by author: FeedIdentifier) async throws -> Bool

/// Fetches the post with the given ID from the database.
func post(from key: MessageIdentifier) throws -> Message

Expand Down
3 changes: 2 additions & 1 deletion Source/Controller/DirectoryViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,8 @@ extension DirectoryViewController: UITableViewDelegate {
}

navigationController?.pushViewController(
ThreadViewController(with: post, startReplying: false), animated: true
MessageViewBuilder.build(identifier: post.id),
animated: true
)
case .network:
let identity = self.people[indexPath.row].identity
Expand Down
2 changes: 1 addition & 1 deletion Source/Controller/NotificationsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ private class NotificationsTableViewDelegate: MessageTableViewDelegate {
self.viewController?.navigationController?.pushViewController(controller, animated: true)
} else if message.contentType == .post {
Analytics.shared.trackDidSelectItem(kindName: "post")
let controller = ThreadViewController(with: message)
let controller = MessageViewBuilder.build(identifier: message.id)
self.viewController?.navigationController?.pushViewController(controller, animated: true)
}
}
Expand Down
10 changes: 9 additions & 1 deletion Source/FakeBot/FakeBot.swift
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,15 @@ class FakeBot: Bot, @unchecked Sendable {
func feed(identity: Identity, completion: PaginatedCompletion) {
completion(StaticDataProxy(), nil)
}


func message(identifier: MessageIdentifier) async throws -> Message? {
return nil
}

func likes(identifier: MessageIdentifier, by author: FeedIdentifier) async throws -> Bool {
return false
}

func post(from key: MessageIdentifier) throws -> Message {
throw FakeBotError.runtimeError("not implemented")
}
Expand Down
2 changes: 2 additions & 0 deletions Source/Generated/Assets+Planetary.swift
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ extension Image {
static let iconTwit = Image("icon-twit", bundle: Bundle.current)
static let imageOnboarding = Image("image-onboarding", bundle: Bundle.current)
static let launch = Image("launch", bundle: Bundle.current)
static let messageNotVisible = Image("message-not-visible", bundle: Bundle.current)
static let missingAboutIcon = Image("missing-about-icon", bundle: Bundle.current)
static let navIconCamera = Image("nav-icon-camera", bundle: Bundle.current)
static let navIconDismiss = Image("nav-icon-dismiss", bundle: Bundle.current)
Expand Down Expand Up @@ -280,6 +281,7 @@ extension UIImage {
static let iconTwit = UIImage(named: "icon-twit", in: Bundle.current, with: nil)!
static let imageOnboarding = UIImage(named: "image-onboarding", in: Bundle.current, with: nil)!
static let launch = UIImage(named: "launch", in: Bundle.current, with: nil)!
static let messageNotVisible = UIImage(named: "message-not-visible", in: Bundle.current, with: nil)!
static let missingAboutIcon = UIImage(named: "missing-about-icon", in: Bundle.current, with: nil)!
static let navIconCamera = UIImage(named: "nav-icon-camera", in: Bundle.current, with: nil)!
static let navIconDismiss = UIImage(named: "nav-icon-dismiss", in: Bundle.current, with: nil)!
Expand Down
Loading

0 comments on commit 7f61003

Please sign in to comment.