Skip to content

feat(web): support list editing for channel array fields#2595

Merged
imguoguo merged 1 commit intosipeed:mainfrom
wj-xiao:feat/channel-list-editing
Apr 21, 2026
Merged

feat(web): support list editing for channel array fields#2595
imguoguo merged 1 commit intosipeed:mainfrom
wj-xiao:feat/channel-list-editing

Conversation

@wj-xiao
Copy link
Copy Markdown
Collaborator

@wj-xiao wj-xiao commented Apr 20, 2026

📝 Description

This PR improves channel configuration editing for array/list fields in the launcher web console.

It adds chip-style list editing for channel array values, including allow_from, allow_origins, group trigger prefixes, and other channel-specific string array settings. The backend now normalizes string, numeric, and array payloads for these fields before saving config patches, so pasted comma/newline-separated values are stored consistently and empty entries are not persisted.

🗣️ Type of Change

  • 🐞 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 📖 Documentation update
  • ⚡ Code refactoring (no functional changes, no api changes)

🤖 AI Code Generation

  • 🤖 Fully AI-generated (100% AI, 0% Human)
  • 🛠️ Mostly AI-generated (AI draft, Human verified/modified)
  • 👨‍💻 Mostly Human-written (Human lead, AI assisted or none)

🔗 Related Issue

N/A

📚 Technical Context (Skip for Docs)

  • Reference URL: N/A
  • Reasoning: Channel array fields were previously edited as comma-separated text, which made it easy to leave accidental whitespace, duplicates, hidden characters, or pending draft text out of the saved payload. This change keeps the UI list-oriented while retaining backend compatibility for string and numeric payloads.

🧪 Test Environment

  • Hardware: Apple Silicon Mac
  • OS: macOS 26.4.1
  • Model/Provider: N/A
  • Channels: Telegram, Discord, Slack, Feishu, Weixin, WeCom, Pico, IRC

📸 Evidence (Optional)

Click to view Logs/Screenshots
go test -tags goolm,stdjson ./pkg/config ./web/backend/api
ok  	github.com/sipeed/picoclaw/pkg/config	2.302s
ok  	github.com/sipeed/picoclaw/web/backend/api	11.250s

pnpm lint
> picoclaw-web@0.0.0 lint /Users/xiao/github/wj-xiao/picoclaw/web/frontend
> eslint .

☑️ Checklist

  • My code/docs follow the style of this project.
  • I have performed a self-review of my own changes.
  • I have updated the documentation accordingly.

Add reusable channel array list controls and parsing utilities for channel forms.
Normalize channel string-array payloads in the backend, including pasted values,
numeric IDs, hidden characters, duplicates, and empty clears.
Also allow FlexibleStringSlice to unmarshal null values and cover the new behavior
with backend and config tests.
@wj-xiao wj-xiao marked this pull request as ready for review April 20, 2026 10:33
@imguoguo imguoguo merged commit ba69922 into sipeed:main Apr 21, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants