Possibility to add Introduction view inside of list
hiddevdploeg opened this issue · 3 comments
Being able to add an introduction view to the roadmap list can give the user some context on what they’re looking at
I did something similar by using the following logic:
NavigationLink {
VStack(spacing: 0) {
Text("Below are some features coming to {app}. Please vote on the things that are most important to you and help shape the roadmap for the {app}'s future.")
.font(.footnote)
.padding()
RoadmapView(configuration: viewStore.roadmapConfiguration)
}
.navigationBarTitle("Roadmap")
.navigationBarTitleDisplayMode(.inline)
} label: {
Label {
Text("Roadmap")
} icon: {
Image(systemName: "map")
}
}
The only downside is that the Text
above the RoadmapView
does not scroll. This causes large type sizes to severely restrict the amount of available space for the feature list to be displayed within.
See Recording
RPReplay_Final1677007976.MP4
The only downside is that the Text above the RoadmapView does not scroll. This causes large type sizes to severely restrict the amount of available space for the feature list to be displayed within.
Yes, my implementation comes with the same limitation. My code looks as follows:
@available(macOS 13.0, *)
struct RoadmapContainerView: View {
let configuration: RoadmapConfiguration
var body: some View {
VStack(spacing: 0) {
Text("RocketSim Roadmap")
.font(.headline)
GroupBox {
Text("These are features that are coming to RocketSim soon. You can vote on the ones you'd love to see me add first. [Let me know](https://github.com/AvdLee/RocketSimApp/issues/new?assignees=AvdLee&labels=enhancement&template=feature_request.md) if you have a suggestion for a feature that needs to be added to this list.")
.padding(10)
}.padding(.horizontal, 20)
.padding(.vertical, 20)
Divider()
.padding(.horizontal, 20)
RoadmapView(configuration: configuration)
.introspectTableView(customize: { tableView in
tableView.enclosingScrollView?.automaticallyAdjustsContentInsets = false
tableView.enclosingScrollView?.contentInsets = .init(top: 20, left: 10, bottom: 20, right: 10)
})
.scrollContentBackground(.hidden)
}
}
}
I can totally see us supporting something like header: () -> some View
that would scroll with the features, similar to the SwiftUI Form Section header API.