Giter VIP home page Giter VIP logo

settingskit-macos's People

Contributors

david-swift avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

alok-dks

settingskit-macos's Issues

Share the code for the screenshots/images

Is your feature request related to a problem? Please describe.

I am new to Swift and am having trouble understanding the use of ColibriComponents.

Describe the solution you'd like

If the screenshots/images in the markdown files were accompanied by the code for them, that'd be a great solution.

Describe alternatives you've considered

Improve the documentation with more examples of actual usage instead of template code.

Additional context

That's all, thanks!

Create a simple sample app

Is your feature request related to a problem? Please describe.

No response

Describe the solution you'd like

Hi @david-swift ,

thank you very much for creating such a great package.

I'm looking for a library which can help me to create a native setting screen for my macOS app and I have just found this repo.

I find that it'd be helpful for us if we can have a sample app demonstrating some common usages for this package.

Wdyt?

Describe alternatives you've considered

N/A

Additional context

N/A

Using TabView within the Setting

Overview

I wanted to render a TabView within the SettingContent but it doesn't seem to work. Any idea why?

Here is my code:

// App.swift
...
.settings {
  SettingsTab(.init("Inline" as String, systemSymbol: .textBelowPhoto), id: "shortcut") {
        SettingsSubtab(.noSelection, id: "no-selection") {
            InlineSettingsView()
        }
    }
  }
//  InlineSettingsView.swift

struct InlineSettingsView: View {
    var body: some View {
        TabView {
            Text("A")
                .tabItem {
                    Label("A", systemSymbol: .person2)
                }
            
            Text("B")
                .tabItem {
                    Label("B", systemSymbol: .person2)
                }
        }
    }
}

I wanted to achieve something like this:

CleanShot 2023-08-28 at 17 35 19@2x

Better looking sidebar buttons

Overview

The design of the sidebar buttons is not great yet. Any chance we can make it minimal like the rest of the macOS apps?

Example XCode app:

CleanShot 2023-07-15 at 18 15 36@2x

Disable the "No Selection" behavior

Is your feature request related to a problem? Please describe.

This feature doesn't make sense when the user always need to edit something on the sidebar. A misclick might render the "No selection" screen which is just a text "No row selected" etc. Which is kinda annoying.

Describe the solution you'd like

Allow developers to specify the behavior. Maybe show "No selection" screen only if there is no rows in the sidebar. Otherwise, always select one row.

Describe alternatives you've considered

Not sure.

Additional context

This is for SettingsSubtab

Is it possible to open the Setting window and automatically select a tab?

Is your feature request related to a problem? Please describe.

Basically the title. Is it possible to trigger the Setting window to select a tab after showing up

Describe the solution you'd like

A method or some other way to set which tab to focus on. Maybe a Binding when creating the Setting View?

Describe alternatives you've considered

Not sure.

Additional context

Not sure.

Menus in the sidebar

Overview

This is more of a question than a feature request though. The actions is working great, however, it's common to show a dropdown menu when clicking on the Plus button, or when clicking on the options

Like this:

CleanShot 2023-08-02 at 13 20 46@2x

How can I achieve this with SettingsKit?

I can see that the ToolbarAction body is a Button. Maybe we should allow developers to specify the body or to create a custom ToolbarAction (make it a protocol maybe)?

@david-swift

Select new item automatically after created

Is your feature request related to a problem? Please describe.

After a new SettingsSubtab is created, SettingsKit does not select that tab automatically. Not a good UX

Describe the solution you'd like

After a new SettingsSubtab is created, automatically select that tab.

Describe alternatives you've considered

Another solution is allowing developer to specify the $selection.

Additional context

Reference:

Use `id` instead of `index` in `.standardActions { }`

Problem Statement

The current implementation of . standardActions {} uses index instead of id for the remove action. This is quite problematic when the order of the list changes, or when there is a mix of static items and dynamic items.

Let me explain. Given this code:

SettingsTab(.init("Models" as String, systemSymbol: .cpu), id: "model") {
  SettingsSubtab(.init("Static Item 1" as String, systemSymbol: .cpu), id: "model-static-1") {
    StaticItem1()
  }

  SettingsSubtab(.init("Static Item 2" as String, systemSymbol: .cpu), id: "model-static-2") {
    StaticItem2()
  }

  for item in dynamicItemList {
    SettingsSubtab(.init(item.name, systemSymbol: .cpu), id: "model-\(recordId)") {
        DynamicItem(item: item)
    }
  }
}
.standardActions {
    // 
} remove: { index in
    // handling index here can be annoying, for example when I add more Static item in the front
    // will need to increase the check for index each time to find the correct item to be removed
}

When removing an item, I always have to check if the index >= 2 (dynamic) or static. When I add new static item to the settings sub-tabs, it's prone to error.

Suggestion

Maybe support both index and id in the callback parameters? Something like this

.standardActions {
    // 
} remove: { id, index in
    // handling index here can be annoying, for example when I add more Static item in the front
    // will need to increase the check for index each time to find the correct item to be removed
}

IMO, id should be the source of truth, not index.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.