Enhancement: set wiki node position among siblings on move/create

Abierto
#2,828 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
43/100
Tipo de issue
Nueva funcionalidad
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
go, openapi
Área
api, cli

Línea de trabajo

Start with the wiki +move and wiki +node-create command definitions and the SDK's service/wiki/v2 request types, including MoveSpaceNodeReqBody. Check whether the upstream Lark Open API now supports a sibling-position field; the matching larksuite/oapi-sdk-go request may determine when this work can begin. Done means the supported ordering option is exposed by both commands and behaves as documented for move and create.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

domain/wiki

Summary

Please let wiki +move and wiki +node-create say where a node should go among its siblings, not just which parent it goes under.

Current behaviour

lark-cli wiki +move (v1.0.98) accepts --node-token, --target-parent-token, --target-space-id, --source-space-id, --obj-type / --obj-token and --apply. +node-create likewise only takes a parent. Lark decides where the node lands among its siblings, and the order can only be changed by dragging the node in the web UI.

This is a gap in the Open API rather than in the CLI: POST /open-apis/wiki/v2/spaces/:space_id/nodes/:node_token/move only accepts target_parent_token and target_space_id, and node create has no position field. So this request is really for the API, with CLI flags to follow. I filed a matching request on larksuite/oapi-sdk-go.

Proposed enhancement

Any one of these would solve it:

  1. An optional prev_node_token (or before / after sibling token) on the move and create endpoints, exposed as e.g. --after-node-token / --before-node-token.
  2. A writable sort_id on move and create, exposed as --sort-id.
  3. A dedicated reorder endpoint that moves a node among its current siblings without changing its parent, e.g. lark-cli wiki +node-reorder --node-token X --after-node-token Y.

Why

The wiki is a natural target for automated publishing: release notes, changelogs, runbooks and generated reports written by CI or by agents through lark-cli. Those trees have a meaningful order, such as newest release first or chapters in sequence. Today every automated publish lands in a position the publisher can't control, so a person has to open the wiki and drag the node into place after each run. That makes a fully automated pipeline impossible and lets the tree drift out of order whenever someone forgets.

The workarounds aren't good. One parent folder per item fragments the tree. Prefixing titles with dates or versions changes the titles readers see and still doesn't control the displayed order. A hand-kept index page duplicates the tree it's meant to describe.

Lark's own UI already supports placing a node anywhere among its siblings, so this would bring the API and CLI up to what the product can already do.

Environment

  • lark-cli 1.0.98
  • Also checked: github.com/larksuite/oapi-sdk-go/v3 v3.12.2, service/wiki/v2 MoveSpaceNodeReqBody
Lenguaje dominante
Go
Estrellas
18.2k
Forks
1.4k
Merge medio
1 d 3 h
PR fusionados (30 d)
18

Preparar el entorno

  • Sin Dockerfile ni archivo de Docker Compose
  • Tiene una plantilla de pull request
  • Sin guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de larksuite/cli

Todos los issues de larksuite/cli

Issues similares

Más issues de Go

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.