Quote + Fixes

This commit is contained in:
lumaa-dev 2024-11-07 22:05:23 +01:00
parent 8503ebc12a
commit 383cdea42d
8 changed files with 39 additions and 18 deletions

View File

@ -116,8 +116,9 @@ struct CompactPostView: View {
if !status.content.asRawText.isEmpty {
TextEmoji(status.content, emojis: status.emojis, language: status.language)
.multilineTextAlignment(.leading)
.frame(width: quoted ? 250 : 300, alignment: .topLeading)
.lineLimit(quoted ? 3 : nil)
.frame(width: quoted ? 180 : 300, alignment: .topLeading)
.frame(maxHeight: 140)
// .lineLimit(quoted ? 3 : nil)
.fixedSize(horizontal: false, vertical: true)
.font(quoted ? .caption : .callout)
.contentShape(Rectangle())
@ -126,7 +127,7 @@ struct CompactPostView: View {
}
}
// if !quoted {
if !quoted {
if status.poll != nil {
PostPoll(poll: status.poll!)
}
@ -135,12 +136,13 @@ struct CompactPostView: View {
PostCardView(card: status.card!)
}
attachmnts
// }
attachmnts
}
if hasQuote && !quoted {
if quoteStatus != nil {
QuotePostView(status: quoteStatus!)
.frame(maxWidth: 250, maxHeight: 200, alignment: .leading)
} else {
ProgressView()
.progressViewStyle(.circular)

View File

@ -9,8 +9,7 @@ struct QuotePostView: View {
var body: some View {
CompactPostView(status: status, quoted: true)
.frame(maxWidth: 250, maxHeight: 200)
.padding(15)
.padding([.horizontal], 20)
.padding(7.5)
.overlay(
RoundedRectangle(cornerRadius: 15)
.stroke(.gray.opacity(0.3), lineWidth: 1)

View File

@ -109,7 +109,7 @@ struct SearchResultView: View {
Spacer()
Button {
// do stuff
navigator.navigate(to: .timeline(timeline: .hashtag(tag: tag.name, accountId: nil)))
} label: {
Text("tag.read")
}
@ -123,6 +123,9 @@ struct SearchResultView: View {
var statusesView: some View {
VStack(spacing: 7.5) {
ForEach(searchResults.statuses) { status in
Divider()
.frame(maxWidth: .infinity)
CompactPostView(status: status)
.padding(.vertical)
}

View File

@ -29,7 +29,9 @@ class FetchTimeline {
public func addStatuses(lastStatusIndex: Int) async -> [Status] {
// print("i: \(lastStatusIndex)\ndatasource-6: \(self.datasource.count - 6)")
guard client != nil && lastStatusIndex >= self.datasource.count - 6 else { return self.datasource }
guard client != nil && lastStatusIndex >= self.datasource.count - 6 && !self.datasource.isEmpty else {
return self.datasource
}
self.statusesState = .loading
let lastStatus = self.datasource.last!

View File

@ -13,9 +13,15 @@ extension Navigator {
let urlPath: URL = URL(string: path) ?? URL(string: "https://example.com/")!
if !url.absoluteString.starts(with: AppInfo.scheme) {
if client.isAuth && client.hasConnection(with: url) {
guard let actionType = urlPath.getActionType() else { fatalError("Couldn't get URLNav actionType") }
guard let actionType = urlPath.getActionType() else {
print("Couldn't get URLNav actionType")
self.presentedSheet = .safari(url: url)
return .handled
}
let server: String = urlPath.host() ?? client.server
// TODO: If "nil" do global search
print("actionType: \(actionType)")
if actionType == .account {

View File

@ -602,6 +602,8 @@ struct ProfileView: View {
.font(.caption)
.foregroundStyle(!isSubClub ? Color.gray : Color.subClub)
.multilineTextAlignment(.leading)
.lineLimit(1)
.minimumScaleFactor(0.7)
.pill(tint: !isSubClub ? Color(uiColor: UIColor.label) : Color.subClub)
}
.disabled(!isSubClub)
@ -620,6 +622,8 @@ struct ProfileView: View {
.font(.caption)
.foregroundStyle(!isSubClub ? Color.gray : Color.subClub)
.multilineTextAlignment(.leading)
.lineLimit(1)
.minimumScaleFactor(0.7)
.pill(tint: !isSubClub ? Color(uiColor: UIColor.label) : Color.subClub)
}
.disabled(!isSubClub)
@ -636,6 +640,8 @@ struct ProfileView: View {
.font(.caption)
.foregroundStyle(!isSubClub ? Color.gray : Color.subClub)
.multilineTextAlignment(.leading)
.lineLimit(1)
.minimumScaleFactor(0.7)
.pill()
}
.disabled(!isSubClub)

View File

@ -39,11 +39,11 @@ struct UpdateView: View {
var features: some View {
VStack(spacing: 60) {
newFeature(systemImage: "figure.child.and.lock.fill", title: "Follow request", text: "A proper follow request button is available on private accounts")
newFeature(imageName: "SubClubMark", title: "sub.club", text: "A full sub.club integration was made in collaboration with them! Thank you!")
newFeature(systemImage: "person.text.rectangle.fill", title: "QRT but for Bubble", text: "Bubble finally displays quote posts properly!")
newFeature(systemImage: "decrease.quotelevel", title: "Post overhaul", text: "Posts and replies are looking fancier than ever before!")
newFeature(systemImage: "wrench.and.screwdriver", title: "A ton of fixes!", text: "A lot of organisation and debugging has been made to give you the best experience!")
}
.frame(height: 500)
}

View File

@ -99,7 +99,7 @@ struct DiscoveryView: View {
var accountsView: some View {
ScrollView(.horizontal, showsIndicators: false) {
LazyHStack(spacing: 10) {
LazyHStack(spacing: 7.5) {
ForEach(suggestedAccounts) { account in
VStack {
ProfilePicture(url: account.avatar, size: 64)
@ -174,8 +174,11 @@ struct DiscoveryView: View {
}
var statusView: some View {
VStack(spacing: 7.5) {
VStack(spacing: 1.5) {
ForEach(trendingStatuses) { status in
Divider()
.frame(maxWidth: .infinity)
CompactPostView(status: status)
.padding(.vertical)
.environmentObject(navigator)