koishijs / koishijs/webui

Feature Request: 指令手动排序

Open
#25 5 comments 0 reactions 0 assignees View on GitHub
feature
Dominant language
Vue
Stars
40
Forks
22
PR merge metrics
No merged PRs in 30d

Description

### Describe the problem related to the feature request

写插件的时候偶尔会期望指令不自动根据字母顺序排列,而是手动指定顺序

![image](https://user-images.githubusercontent.com/29368226/154191370-363d2c7a-7932-4e08-8507-7cc0215b8e65.png)

比如上图中会更加期望指令以 现在、昨日、周、月、年、总计 的顺序排列,而不是自动字母顺序(现在这个看起来就很生草)

### Describe the solution you'd like

给指令(`ctx.command`)新增一个配置项(比如 `order`?先假设是 `order`),用来指定顺序,`order` 是一个数,不设置时默认为 0(或者其他值?),指令按照数值从大到小(或者从小到大?可能更倾向于从大到小)排序,`order` 相同时按照字母顺序排序

### Describe alternatives you've considered

感觉上面这个是兼容性最好的!

### Additional context

无了

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating how ctx.command options are defined and where commands are displayed and sorted. Confirm the intended default and sort direction with maintainers, then verify that an explicit numeric order controls placement and equal orders retain alphabetical ordering.

Written by the indexing model from the issue text.

Assessment

Domain
frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.