Skip to content

feat: improve clipboard shelf and support Zhipu API endpoints - #1

Merged
idoubi merged 2 commits into
thinkany-ai:mainfrom
xysamuel:feat/clipboard-shelf-zhipu
Oct 20, 2026
Merged

idoubi merged 2 commits into
thinkany-ai:mainfrom
xysamuel:feat/clipboard-shelf-zhipu

Conversation

@xysamuel

Copy link
Copy Markdown
Contributor

Summary

This PR combines two improvements, kept in separate commits for review:

  1. Clipboard shelf: an optional horizontal bottom-shelf presentation with larger image previews, per-card Send/Copy actions, filters, and the existing list/detail view.
  2. Zhipu / BigModel support: correct endpoint construction for versioned API bases such as https://open.bigmodel.cn/api/coding/paas/v4, plus Coding Plan and standard BigModel presets.

Clipboard changes

  • Add persistent Cards / List switching; cards are the default when no preference exists.
  • Position the shelf within the display's visible frame, avoiding the Dock/menu bar; restore ordinary launcher geometry when leaving it. Detached windows remain user-sized.
  • Give image cards up to 384 px of width, minimal padding, uncropped aspect-preserving images, 768 px thumbnails, and up to 1440 px full previews.
  • Add visible Send and Copy buttons to each card. Send uses the existing paste-to-previous-application path: it does not press Return or submit a message. Copy targets that card, shows feedback, and leaves the shelf open.
  • Support all/pinned/text/link/image/file filters, search, full preview and keyboard navigation. Retain clear confirmation and preserve pinned records.
  • Lazy-load thumbnails with size-aware, bounded caches. Render copied text literally; do not execute HTML or fetch remote link previews.
  • Include English / Simplified Chinese strings, light/dark styles, responsive narrow-window layouts, focus indicators and button labels.

The new layout request is restricted to the bundled clipboard extension. Existing one-argument thumbnail callers keep the 96 px default, and image access retains the existing clipboard permission check.

Model endpoint fix

Previously, only a /v1 suffix was recognized, so a Zhipu /v4 base became /v4/v1/chat/completions.

The builder now:

  • Preserves complete /chat/completions or /messages endpoints.
  • Recognizes terminal version segments such as /v1, /v3, /v4, and /v1beta, appending only the API method path.
  • Retains /v1/... fallback for unversioned bases, including existing DeepSeek, OpenRouter and Anthropic-compatible providers.
  • Trims surrounding whitespace/newlines and trailing slashes.
  • Adds Zhipu Coding Plan and standard BigModel presets.

Validation performed locally

  • ./scripts/test-model-endpoints.sh — 25 checks passed, compiling the production endpoint builder; no network calls, model keys or persisted settings.
  • ./scripts/test-clipboard.sh — 1200×466 light fixture; 57 PASS checks (including shelf geometry).
  • ./scripts/test-clipboard.sh 1200 466 --dark — 57 PASS checks.
  • ./scripts/test-clipboard.sh 420 268 — 56 PASS checks.
  • ./scripts/test-clipboard.sh 420 268 --dark — 56 PASS checks.
  • ./scripts/bundle.sh release --universal — arm64 + x86_64 development bundle.
  • SPOTCAT_CHANNEL=release ./scripts/bundle.sh release --universal — arm64 + x86_64 release-channel bundle, matching the existing CI build command.
  • codesign --verify --deep --strict on both resulting ad-hoc-signed bundles.
  • git diff --check and candidate-file scan for credentials, private keys and personal absolute paths.

WebKit checks use synthetic in-memory records and mocked clipboard APIs. They cover card/list persistence, large-image geometry, clicked-card action targeting, duplicate prevention, feedback/error paths, keyboard navigation, filters, preview/search races, injection safety, clear confirmation, and 1,000-entry rendering. They do not exercise real cross-application paste or live provider authentication. Physical multi-monitor placement, Accessibility permission prompts and real cross-app paste remain manual integration checks; no claim of those being covered by the fixtures is intended.

Endpoint regression checks are also added to the existing CI workflow. Reproduction details and bridge behavior are documented in docs/clipboard-shelf.md. Screenshots are not attached to this submission.

Scope / privacy

No API keys, clipboard history, model settings, local signing identities/certificates, application backups or build artifacts are included. This PR does not change signing/install/release scripts, application identifiers, or update behavior. Local-only certificate/installation changes have deliberately been excluded.

@idoubi
idoubi merged commit 4154e9f into thinkany-ai:main Oct 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants