Open devmoath opened 2 years ago
Maybe have the folder grayed out? Or have an option which says "Show hidden folders"?
@Muhammed9991 I wonder if this should be a separate setting for this like so...
I like this idea more. Gives the user more flexibility about which files they want to hide. Especially good for larger projects.
that's even better, I liked the idea 👍
Awesome, I said I'd take this on in Discord so I should have a draft PR ready in a couple days 👍
This is taking me longer than expected, and I'm focusing on editor changes in the text view right now. If anyone wants to take this on DM me on Discord and I can share the resources I have with you on glob patterns, etc.
If no one takes this on by the time I'm done with my other things I'll continue working on this issue.
Got started working on a component to let the user specify which folders they want to ignore. This is just to get the ball rolling on this issue. Let me know what you guys think, I tried copying the design from the macOS settings menu for lists. (The compression removes the row highlights when the modal is open)
@FastestMolasses This looks really good. We are going to need this for #1462 and #1463 as well.
@austincondiff Hey, just getting back to this! Here's the code written for it. I've placed it in a folder called Components in my branch, not sure where's the best place to put the code.
import SwiftUI
struct ListTableItem: Identifiable {
let id = UUID()
var name: String
}
struct ContentView: View {
@State private var items = [ListTableItem]()
@State private var showingModal = false
@State private var selection: ListTableItem.ID?
var body: some View {
VStack {
Table(items, selection: $selection) {
TableColumn("Items", value: \.name)
}
}
.paneToolbar {
HStack(spacing: 2) {
Button {
showingModal = true
} label: {
Image(systemName: "plus")
}
Divider()
.frame(minHeight: 15)
Button {
removeItem()
} label: {
Image(systemName: "minus")
}
.disabled(selection == nil)
.opacity(selection == nil ? 0.5 : 1)
}
Spacer()
}
.sheet(isPresented: $showingModal) {
NewListTableItemView { text in
items.append(ListTableItem(name: text))
showingModal = false
}
}
.cornerRadius(6)
}
private func removeItem() {
guard let selectedId = selection else { return }
items.removeAll(where: { $0.id == selectedId })
selection = nil
}
}
struct NewListTableItemView: View {
@State private var text = ""
var completion: (String) -> Void
var body: some View {
VStack {
Text("Enter new item name")
TextField("Name", text: $text)
.textFieldStyle(.roundedBorder)
Button("Add") {
if !text.isEmpty {
completion(text)
}
}
}
.padding()
}
}
struct ListTablePreview: PreviewProvider {
static var previews: some View {
ContentView()
.environmentObject(DebugAreaTabViewModel())
}
}
@FastestMolasses Is this one complete?
Is your feature request related to a problem? Please describe.
No response
Describe the solution you'd like
Most of the IDEs and code editors hide the
.git
folder by default, I believe it's a good idea to follow the same behavior in CodeEdit as well.Describe alternatives you've considered
Well, another way to implement this feature is by categorize the project tree and add
ignored folders
/hidden folders
category which.git
folder will be within it.Additional context
this is what looks like when you open project contains git
Edit by @austincondiff:
As discussed in Discord, we will have something similar to this in VS Code where we can exclude files and folders based on user defined glob patterns.