Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
132 commits
Select commit Hold shift + click to select a range
37c509e
Fix unread dot in forum row
Xialtal May 28, 2025
dbb4af1
Merge remote-tracking branch 'origin/develop' into develop
Xialtal Jun 4, 2025
169cbf6
Merge remote-tracking branch 'origin/develop' into feature/write-form
Xialtal Jun 6, 2025
a580ba9
Bump API version
Xialtal Jun 6, 2025
2e21603
Topic and post templates draft
Xialtal Jun 6, 2025
dac1e8c
Add toasts reflecting the result of creating a topic
Xialtal Jun 6, 2025
3cedca1
Improve topic creation toasts
Xialtal Jun 6, 2025
1b64869
Merge branch 'merge/write-form' into feature/write-form
SubvertDev Jun 15, 2025
28300f4
Post-merge fix
SubvertDev Jun 15, 2025
194ecb9
Merge branch 'merge/write-form' into feature/write-form
SubvertDev Jun 15, 2025
9095c13
Post-merge fix
SubvertDev Jun 15, 2025
9b3856f
Merge branch 'develop' into feature/write-form
SubvertDev Jun 15, 2025
1568140
Fix form empty content on post reply
Xialtal Jun 15, 2025
e901cdb
Post-merge fix
Xialtal Jun 15, 2025
6dea6a9
Post-merge fix
Xialtal Jun 15, 2025
ca97d42
Bump API version
Xialtal Jul 19, 2025
80e90cf
Add upload endpoint
Xialtal Jul 19, 2025
4d97e55
WIP
Xialtal Jul 19, 2025
4e0d20b
Merge branch 'develop' into feature/write-form
SubvertDev Jul 19, 2025
8e6b8e2
Fix big tokens parsing in forms
SubvertDev Aug 12, 2025
bc49306
Update packages
SubvertDev Aug 12, 2025
1ee84c2
Fix Sharing tests crash
SubvertDev Aug 12, 2025
39fb497
WIP
SubvertDev Aug 12, 2025
d9d94b5
Unit tests changes
SubvertDev Aug 13, 2025
dac3598
Bump tuist version
SubvertDev Aug 13, 2025
e897169
Merge remote-tracking branch 'origin/develop' into feature/write-form
SubvertDev Aug 14, 2025
8ab9879
Merge branch 'develop' into feature/write-form
SubvertDev Sep 2, 2025
caf1a24
[WIP] BB Panel
Xialtal Jan 1, 2026
1fc3548
Disable all write form field previews
Xialtal Jan 1, 2026
f0b5544
Add selection support for ForField
Xialtal Jan 1, 2026
09fd4b5
Add bb panel support for write form
Xialtal Jan 1, 2026
1c52ed8
Use ForField for reputation change
Xialtal Jan 1, 2026
3aa41b0
Field refactoring
Xialtal Jan 1, 2026
850e869
Fix bb panel localization
Xialtal Jan 1, 2026
2f90164
Fix color code in bb panel
Xialtal Jan 1, 2026
b37d9bd
Remove smile tag from bb panel
Xialtal Jan 2, 2026
baa9c27
Remove unused import
Xialtal Jan 2, 2026
ae6a99e
[WIP] BBPanel List Tag
Xialtal Jan 2, 2026
7a242b7
Fix input field for list code in bb panel
Xialtal Jan 2, 2026
194d8db
BB Panel list tag improvements
Xialtal Jan 2, 2026
7f1ccf4
[WIP] Upload and BBPanel
Xialtal Feb 22, 2026
10b46cc
Merge remote-tracking branch 'origin/feature/write-form' into feature…
Xialtal Feb 22, 2026
a884f26
FormFeature improvements
Xialtal Feb 22, 2026
b3f0505
Extract UploadBox to own feature
Xialtal Feb 22, 2026
84bc548
Move FormFeature to common Field
Xialtal Feb 22, 2026
f048f62
Add releaser for topic
Xialtal Feb 22, 2026
cdf2574
Add checkboxList support for FormFeature
Xialtal Feb 22, 2026
a76c075
Add create topic context menu action for forum
Xialtal Feb 22, 2026
63c378f
[WIP] UploadBox
Xialtal Feb 22, 2026
9665325
Update localization
Xialtal Feb 22, 2026
c9e9ca9
Merge remote-tracking branch 'origin/develop' into feature/project-su…
Xialtal Feb 22, 2026
497358c
Post-merge fixes
Xialtal Feb 22, 2026
4d7252e
Post-merge fixes
Xialtal Feb 22, 2026
40953c1
Improve dropdown for liquid glass in FormFeature
Xialtal Feb 22, 2026
85e3026
Add analytics to FormFeature
Xialtal Feb 22, 2026
8a96728
Post-merge fix
Xialtal Feb 22, 2026
550bb1f
Add input length limit for text field in FormFeature
Xialtal Feb 23, 2026
65e80a0
[WIP] UploadBox
Xialtal Feb 23, 2026
d292f9b
Fix alerts in FormFeature
Xialtal Feb 23, 2026
d7b4cdf
Bump API version
Xialtal Feb 23, 2026
4621244
[WIP] FormFeature
Xialtal Feb 23, 2026
ab7de70
Fix attachments in template preview
Xialtal Feb 23, 2026
d85c171
Lock form while file uploading
Xialtal Feb 23, 2026
5a14c6d
Fix alerts for FormScreen
Xialtal Feb 24, 2026
5e010e8
Add comment for empty form titles
Xialtal Feb 24, 2026
e64169d
Add template response handling for FormFeature
Xialtal Feb 24, 2026
d7d53e0
Add post template preview
Xialtal Feb 24, 2026
c726d48
Improve localizable
Xialtal Feb 24, 2026
33e0405
UploadBox improvements
Xialtal Feb 24, 2026
7881cb4
Improvements
Xialtal Feb 24, 2026
ef54aa3
Localizable improvements
Xialtal Feb 24, 2026
2e2dafa
Add attachment tag to BBPanel
Xialtal Feb 24, 2026
735d259
Remove warning
Xialtal Feb 24, 2026
f2e736b
[WIP] UploadBox
Xialtal Feb 24, 2026
fa0f7b1
Use TopicBuilder for fields BB codes parsing
Xialtal Feb 24, 2026
e303508
UploadBox improvements
Xialtal Feb 25, 2026
2874088
Fix file reupload
Xialtal Feb 25, 2026
396433e
Fix uploaded files counter for BBPanel
Xialtal Feb 25, 2026
62294ed
Bump API version
Xialtal Feb 26, 2026
f478e7f
[WIP] UploadBox
Xialtal Feb 26, 2026
e7825af
Remove unused code
Xialtal Feb 27, 2026
44da2fd
Form improvements
Xialtal Feb 27, 2026
1ce175c
Disable action buttons on form loading
Xialtal Feb 27, 2026
a79791b
Improve Form namings
Xialtal Feb 27, 2026
d7749e9
Fix Form tests
Xialtal Feb 27, 2026
1813026
UploadBox improvements
Xialtal Feb 27, 2026
0afb8af
Add post preview support
Xialtal Feb 27, 2026
ea9eb13
Improvements
Xialtal Feb 27, 2026
6178bb8
UploadBox improvements
Xialtal Feb 27, 2026
63b094d
Add FormAttachment model
Xialtal Feb 27, 2026
c19f0bf
Add post with attachment edit support
Xialtal Feb 27, 2026
498afdb
Add ComingSoonView
Xialtal Feb 27, 2026
09ca6d9
Fix topic analytics
Xialtal Feb 27, 2026
6314beb
Improve localizable
Xialtal Feb 27, 2026
b4ff02b
Improve Form analytics
Xialtal Feb 27, 2026
18a14e3
FormPreview improvements
Xialtal Feb 27, 2026
bd05ed6
Add model for Form flag
Xialtal Mar 2, 2026
60080d3
Fix flag check for required field
Xialtal Mar 2, 2026
1b9b13a
Use FormFlag as global model for Form
Xialtal Mar 2, 2026
e0d3f84
Fix perception tracking in Form preview
Xialtal Mar 2, 2026
1f687d7
[WIP] Form Editor with upload
Xialtal Mar 7, 2026
90879cd
UploadBox improvements
Xialtal Mar 7, 2026
ff33131
Rename FormFlag to FormFieldFlag
Xialtal Mar 7, 2026
4d50a5d
Fix post edit reason field in Form
Xialtal Mar 11, 2026
c09605d
Improve bbPanel list tag
Xialtal Mar 11, 2026
01fc716
WIP
Xialtal Mar 11, 2026
166d735
Fix Form content building
Xialtal Mar 11, 2026
3700269
Merge branch 'develop' into feature/project-sunlight
Xialtal Mar 14, 2026
7244c19
Fix send button on profile edit screen
Xialtal Mar 14, 2026
42331e6
Merge remote-tracking branch 'origin/develop' into feature/project-su…
Xialtal Mar 14, 2026
d139d48
Fix Form warning
Xialtal Mar 14, 2026
04c2a21
Fix tests for FormFeature
Xialtal Mar 14, 2026
40d95c3
Fix caret position in editor field for non-empty text
Xialtal Mar 16, 2026
a33ae86
Fix bbPanel type for profile edit
Xialtal Mar 16, 2026
c150fb8
Temporary disable url bb tag for profile edit
Xialtal Mar 16, 2026
a6d1c14
UploadBox improvements
Xialtal Mar 17, 2026
8fb160b
Add a check for files with empty extensions
Xialtal Mar 18, 2026
d783927
Clean BBPanelTag model
Xialtal Mar 18, 2026
e76ca5b
Add BBPanel to EditScreen
Xialtal Mar 18, 2026
55d3842
Update API
Xialtal Mar 18, 2026
479e2bb
Enable tuist cache
Xialtal Mar 18, 2026
08926da
Merge remote-tracking branch 'origin/develop' into feature/project-su…
Xialtal Mar 21, 2026
c099df9
Post-merge fix
Xialtal Mar 21, 2026
121768f
Post-merge fix
Xialtal Mar 21, 2026
e654069
Fix FormFeature tests
Xialtal Mar 21, 2026
4ad995a
Fix uploadbox for not required editors
Xialtal Mar 21, 2026
7dcf0d0
Add auto jump to created topic
Xialtal Mar 21, 2026
9c4e8e7
Improve form result handling for post
Xialtal Mar 21, 2026
37d9e46
Improve report in FormFeature
Xialtal Mar 21, 2026
88d4f79
Add report creation toast to TopicFeature
Xialtal Mar 21, 2026
0984468
Add report creation toast to ReputationFeature
Xialtal Mar 21, 2026
27f8a8d
Merge remote-tracking branch 'origin/develop' into feature/project-su…
Xialtal Mar 22, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 30 additions & 7 deletions Modules/Sources/APIClient/APIClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ import ComposableArchitecture
import PersistenceKeys

public typealias ConnectionState = API.ConnectionState
public typealias UploadRequest = PDAPI.UploadRequest
public typealias UploadProgressStatus = PDAPI.UploadProgressStatus
public typealias PDAPIDocument = PDAPI.Document
public typealias PDAPIError = APIError

// MARK: - Client
Expand Down Expand Up @@ -59,10 +61,12 @@ public struct APIClient: Sendable {
public var markRead: @Sendable (_ id: Int, _ isTopic: Bool) async throws -> Bool
public var getAnnouncement: @Sendable (_ id: Int) async throws -> Announcement
public var getTopic: @Sendable (_ id: Int, _ page: Int, _ perPage: Int, _ postsFilter: TopicPostsFilter) async throws -> Topic
public var getTemplate: @Sendable (_ request: ForumTemplateRequest, _ isTopic: Bool) async throws -> [WriteFormFieldType]
public var getTemplate: @Sendable (_ request: ForumTemplateRequest, _ isTopic: Bool) async throws -> [FormFieldType]
public var sendTemplate: @Sendable (_ id: Int, _ content: PDAPIDocument, _ isTopic: Bool) async throws -> TemplateSend
public var getHistory: @Sendable (_ offset: Int, _ perPage: Int) async throws -> History
public var getMentions: @Sendable (_ showPosts: Bool, _ offset: Int, _ perPage: Int) async throws -> Mentions
public var previewPost: @Sendable (_ request: PostPreviewRequest) async throws -> PostPreview
public var previewPost: @Sendable (_ request: PostPreviewRequest) async throws -> PreviewResponse
public var previewTemplate: @Sendable (_ id: Int, _ content: PDAPIDocument, _ isTopic: Bool) async throws -> PreviewResponse
public var sendPost: @Sendable (_ request: PostRequest) async throws -> PostSendResponse
public var editPost: @Sendable (_ request: PostEditRequest) async throws -> PostSendResponse
public var deletePosts: @Sendable (_ postIds: [Int]) async throws -> Bool
Expand Down Expand Up @@ -344,6 +348,14 @@ extension APIClient: DependencyKey {
let response = try await api.send(command)
return try await parser.parseWriteForm(response)
},
sendTemplate: { id, content, isTopic in
let command = ForumCommand.template(
type: isTopic ? .topic(forumId: id) : .post(topicId: id),
action: .send(content)
)
let response = try await api.send(command)
return try await parser.parseTemplateSend(response: response)
},

getHistory: { offset, perPage in
let response = try await api.send(MemberCommand.history(page: offset, perPage: perPage))
Expand All @@ -365,6 +377,14 @@ extension APIClient: DependencyKey {
let response = try await api.send(command)
return try await parser.parsePostPreview(response)
},
previewTemplate: { id, content, isTopic in
let command = ForumCommand.template(
type: isTopic ? .topic(forumId: id) : .post(topicId: id),
action: .preview(content)
)
let response = try await api.send(command)
return try await parser.parseTemplatePreview(response: response)
},

sendPost: { request in
let command = ForumCommand.Post.send(data: PostSendRequest(
Expand Down Expand Up @@ -620,7 +640,10 @@ extension APIClient: DependencyKey {
return .mock
},
getTemplate: { _, _ in
return [.mockTitle, .mockText, .mockEditor]
return [.mockTitle, .mockRequiredText, .mockRequiredEditor, .mockEditor, .mockUploadBox]
},
sendTemplate: { _, _, isTopic in
return .success(isTopic ? .topic(id: 0) : .post(PostSend(id: 0, topicId: 1, offset: 2)))
},
getHistory: { _, _ in
return .mock
Expand All @@ -629,10 +652,10 @@ extension APIClient: DependencyKey {
return .mock
},
previewPost: { request in
return PostPreview(
content: request.post.content,
attachmentIds: request.post.attachments
)
return PreviewResponse(content: request.post.content, attachments: [.mock])
},
previewTemplate: { _, _, _ in
return PreviewResponse(content: "content", attachments: [.mock])
},
sendPost: { _ in
return .success(PostSend(id: 0, topicId: 1, offset: 2))
Expand Down
8 changes: 4 additions & 4 deletions Modules/Sources/APIClient/Requests/ForumTemplateRequest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ public struct ForumTemplateRequest {

public enum TemplateAction {
case get
case send([Any])
case preview([Any])
case send(PDAPIDocument)
case preview(PDAPIDocument)
}

public init(id: Int, action: TemplateAction) {
Expand All @@ -27,8 +27,8 @@ extension ForumTemplateRequest.TemplateAction {
var transferType: ForumCommand.TemplateAction {
switch self {
case .get: return .get
case .preview: return .preview(Document())
case .send: return .send(Document())
case .preview(let data): return .preview(data)
case .send(let data): return .send(data)
}
}
}
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
//
// WriteFormEvent.swift
// FormEvent.swift
// ForPDA
//
// Created by Ilia Lubianoi on 13.12.2025.
//

public enum WriteFormEvent: Event {
public enum FormEvent: Event {

case writeFormSent
case formSent
case publishTapped
case dismissTapped
case previewTapped

public var name: String {
return "Write Form " + eventName(for: self).inProperCase
return "Form " + eventName(for: self).inProperCase
}

public var properties: [String: String]? {
Expand Down
2 changes: 1 addition & 1 deletion Modules/Sources/AnalyticsClient/Events/TopicEvent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ public enum TopicEvent: Event {
case userTapped(Int)
case urlTapped(URL)
case imageTapped(URL)
case editWarningSheetClosed
case textQuoted(Int)

case menuCopyLink
case menuOpenInBrowser
case menuGoToEnd
case menuSetFavorite
case menuWritePost
case menuWritePostWithTemplate

case menuPostReply(Int)
case menuPostKarma(Int)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ extension CommentFeature {
var body: some Reducer<State, Action> {
Reduce<State, Action> { state, action in
switch action {
case .onTask, ._timerTicked, ._likeResult, .alert, .delegate, .writeForm, .changeReputation:
case .onTask, ._timerTicked, ._likeResult, .alert, .delegate, .report, .changeReputation:
break

case .profileTapped:
Expand Down
42 changes: 15 additions & 27 deletions Modules/Sources/ArticleFeature/Comments/CommentFeature.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import PersistenceKeys
import APIClient
import Models
import ToastClient
import WriteFormFeature
import ReputationChangeFeature
import FormFeature

public enum CommentContextMenuOptions {
case report
Expand All @@ -28,8 +28,6 @@ public struct CommentFeature: Reducer, Sendable {
// MARK: - Localizations

public enum Localization {
static let errorSendingReport = LocalizedStringResource("Error sending report", bundle: .module)
static let reportTooShort = LocalizedStringResource("Report too short", bundle: .module)
static let reportSent = LocalizedStringResource("Report sent", bundle: .module)
}

Expand All @@ -38,8 +36,8 @@ public struct CommentFeature: Reducer, Sendable {
@ObservableState
public struct State: Equatable, Identifiable {
@Presents public var alert: AlertState<Never>?
@Presents var writeForm: WriteFormFeature.State?
@Presents var changeReputation: ReputationChangeFeature.State?
@Presents var report: FormFeature.State?
@Shared(.userSession) public var userSession: UserSession?
public var id: Int { return comment.id }
public var comment: Comment
Expand Down Expand Up @@ -88,8 +86,8 @@ public struct CommentFeature: Reducer, Sendable {
case likeButtonTapped
case changeReputationButtonTapped

case writeForm(PresentationAction<WriteFormFeature.Action>)
case changeReputation(PresentationAction<ReputationChangeFeature.Action>)
case report(PresentationAction<FormFeature.Action>)

case _likeResult(Bool)
case _timerTicked
Expand Down Expand Up @@ -130,24 +128,12 @@ public struct CommentFeature: Reducer, Sendable {
case let .profileTapped(id):
return .send(.delegate(.commentHeaderTapped(id)))

case .writeForm(.presented(.delegate(.writeFormSent(let response)))):
if case let .report(result) = response {
let toast: ToastMessage
switch result {
case .error:
toast = ToastMessage(text: Localization.errorSendingReport, isError: true, haptic: .error)
case .tooShort:
toast = ToastMessage(text: Localization.reportTooShort, isError: true, haptic: .error)
case .success:
toast = ToastMessage(text: Localization.reportSent, haptic: .success)
}
return .run { _ in
await toastClient.showToast(toast)
}
case .report(.presented(.delegate(.formSent(.report)))):
return .run { _ in
await toastClient.showToast(ToastMessage(text: Localization.reportSent, haptic: .success))
}
return .none

case .writeForm, .changeReputation:
case .report, .changeReputation:
return .none

case .hiddenLabelTapped:
Expand All @@ -158,10 +144,12 @@ public struct CommentFeature: Reducer, Sendable {
guard state.isAuthorized else {
return .send(.delegate(.unauthorizedAction))
}
state.writeForm = WriteFormFeature.State(formFor: .report(
id: state.comment.id,
type: .comment
))
state.report = FormFeature.State(
type: .report(
id: state.comment.id,
type: .comment
)
)
return .none

case .changeReputationButtonTapped:
Expand Down Expand Up @@ -216,8 +204,8 @@ public struct CommentFeature: Reducer, Sendable {
return .none
}
}
.ifLet(\.$writeForm, action: \.writeForm) {
WriteFormFeature()
.ifLet(\.$report, action: \.report) {
FormFeature()
}
.ifLet(\.$changeReputation, action: \.changeReputation) {
ReputationChangeFeature()
Expand Down
6 changes: 3 additions & 3 deletions Modules/Sources/ArticleFeature/Comments/CommentsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import NukeUI
import SharedUI
import SkeletonUI
import SFSafeSymbols
import WriteFormFeature
import ReputationChangeFeature
import FormFeature

// MARK: - Comments View

Expand Down Expand Up @@ -118,9 +118,9 @@ struct CommentView: View {
}
.padding(.leading, 16 * CGFloat(store.comment.nestLevel))
}
.fullScreenCover(item: $store.scope(state: \.writeForm, action: \.writeForm)) { store in
.fullScreenCover(item: $store.scope(state: \.report, action: \.report)) { store in
NavigationStack {
WriteFormScreen(store: store)
FormScreen(store: store)
}
}
.fittedSheet(
Expand Down
11 changes: 1 addition & 10 deletions Modules/Sources/ArticleFeature/Resources/Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
}
},
"Error sending report" : {
"extractionState" : "stale",
"localizations" : {
"ru" : {
"stringUnit" : {
Expand Down Expand Up @@ -171,16 +172,6 @@
}
}
},
"Report too short" : {
"localizations" : {
"ru" : {
"stringUnit" : {
"state" : "translated",
"value" : "Слишком короткая жалоба"
}
}
}
},
"Reputation" : {
"localizations" : {
"ru" : {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public struct BBTokenizer {

if currentIndex < input.endIndex {
let string = String(input[tagStartIndex..<currentIndex])
let tag = BBTag(rawValue: string)
let tag = BBTag(rawValue: string.lowercased())
if let tag {
advanceIndex()
return .closingTag(tag)
Expand All @@ -78,7 +78,7 @@ public struct BBTokenizer {
}

let string = String(input[tagStartIndex..<currentIndex])
guard let tag = BBTag(rawValue: string) else {
guard let tag = BBTag(rawValue: string.lowercased()) else {
// Если мы встретили открывающий тег который не закрылся до конца сообщения, то advance делать не надо
if currentIndex < input.endIndex {
advanceIndex()
Expand Down
Loading
Loading