@@ -34,6 +34,7 @@ struct ShareManagementView: View {
3434 @State private var toastMessage : ToastMessagePayload ?
3535 @State private var errorTitle : String ?
3636 @State private var errorMessage : String ?
37+ @State private var expandedPaths : Set < String > = [ ]
3738
3839 private func fetchSharedContent( ) {
3940 guard let url = URL ( string: " \( auth. serverURL) /api/shares " ) else {
@@ -131,17 +132,25 @@ struct ShareManagementView: View {
131132 . frame ( maxWidth: . infinity, alignment: . center)
132133 . padding ( )
133134 } else {
134- ForEach ( $ sharedContent, id: \. self) { $ sharedPath in
135- GeometryReader { geometry in
135+ ForEach ( sharedContent, id: \. self) { sharedPath in
136+ VStack ( alignment : . leading , spacing : 4 ) {
136137 HStack {
137138 Text ( sharedPath. path)
139+ . lineLimit ( expandedPaths. contains ( sharedPath. path) ? nil : 1 )
138140 . foregroundColor ( . primary)
139- . frame ( width: geometry. size. width * 0.6 , alignment: . leading) // 60%
140-
141+ . truncationMode ( . middle)
142+ . onTapGesture {
143+ if expandedPaths. contains ( sharedPath. path) {
144+ expandedPaths. remove ( sharedPath. path)
145+ } else {
146+ expandedPaths. insert ( sharedPath. path)
147+ }
148+ }
149+ Spacer ( )
141150 Text ( " Duration: \( timeLeftString ( until: sharedPath. expire) ) " )
142151 . font ( . footnote)
143152 . foregroundColor ( . gray)
144- . frame ( width : geometry . size . width * 0.4 , alignment: . trailing) // 40%
153+ . frame ( maxWidth : . infinity , alignment: . trailing)
145154 }
146155 }
147156 . swipeActions ( edge: . leading, allowsFullSwipe: false ) {
@@ -184,6 +193,9 @@ struct ShareManagementView: View {
184193 fetchSharedContent ( )
185194 }
186195 }
196+ . onDisappear {
197+ expandedPaths. removeAll ( )
198+ }
187199 }
188200 }
189201}
0 commit comments