Skip to content

feat(site-packs): add LongCat AI site pack - #828

Open
urzeye wants to merge 5 commits into
mainfrom
feat/site-pack-longcat
Open

feat(site-packs): add LongCat AI site pack#828
urzeye wants to merge 5 commits into
mainfrom
feat/site-pack-longcat

Conversation

@urzeye

@urzeye urzeye commented Aug 14, 2026

Copy link
Copy Markdown
Owner

SitePack contribution / SitePack 贡献

Site / 站点

Tested environment / 测试环境

  • Ophel version / Ophel 版本: 1.2.0
  • Browser and version / 浏览器及版本: Selectors verified against a SingleFile snapshot of a live logged-in conversation page (captured 2026-08-14) plus the site's bundled CSS rules; all declared selectors were matched programmatically against the captured DOM.
  • Tested origin(s) / 已测试域名: https://longcat.chat
  • Account or rollout notes / 账号或灰度说明: Snapshot taken from a logged-in account; the share page is publicly accessible and renders the same message components.

Declared and tested capabilities / 已声明并验证的能力

  • outline
  • outline-user-queries
  • conversation-list
  • export-basic
  • model-lock
  • generation-detect
  • new-chat
  • stop-generation
  • width
  • zen
  • clean
  • prompt-insert
  • reading-history

Limitations / 说明:

  • conversation-list is not declared: sidebar items (.conv-item) carry no conversation id in the DOM (no href/data-*), so idFrom cannot be satisfied.
  • model-lock is not declared: no model switcher exists in the captured page.
  • generation-detect / stop-generation rely on .chatInput .stop-generate: the button only renders while generating, so it is absent from the static snapshot; its existence and styling are confirmed by the site's bundled CSS (.chat-input-wrap .send-wrap .stop-generate). A live generating-state check is still recommended before release.
  • themeSync is not declared: the host theme storage mechanism was not verified.
  • reading-history was initially declared but removed: ReadingHistoryManager's scroll-position restore fights outline title jumps on this site (clicks look dead unless scroll lock is enabled, while scroll to top/bottom/anchors work). Because the manager previously started from the global persistence setting without consulting declared capabilities, the pack-side removal is paired with a core fix that gates manager creation on adapter.hasFeatureCapability("reading-history") in both initReadingHistoryManager and the settings-update path. All 15 built-in sites declare the capability, so their behavior is unchanged. chatContent stays in the pack because quick quote, inline bookmarks, and the usage counter also consume it.
  • Session paths verified from the URLs above: conversations live under /c/<id>, share pages under /share/<id>, new chat at /.

Evidence / 验证证据

  • Screenshots or recording / 截图或录屏: SingleFile snapshot of a real two-turn conversation (user query + assistant markdown answer with search citations); every declared selector was matched against this DOM.
  • Selector stability evidence / 选择器稳定性依据: Only semantic component classes are used (v-message-list, v-chat-messge-view, v-chat-user-message, user-text, v-chat-assistant-message, md-show-container, slider-header, new-content, chatInput, send-btn, stop-generate, slider-menus, page-footer, conversation-list, #pageContentScroll). Hashed Vue data-v-* attributes and localized visible text are deliberately not used.
  • Relevant network request shape / 相关网络请求结构: n/a — generation detection is DOM-based (generating.existsSelectors), no network monitor rules.

Contributor checklist / 贡献者检查

  • I copied the repository example and removed fields that the site does not use.
  • pnpm registry:validate passes. (7 SitePacks validated)
  • pnpm registry:build passes and I did not commit registry/dist/.
  • The ID is unique; matches are HTTPS, narrow, and do not overlap built-in or existing packs.
  • version was incremented for an update, and minAppVersion is the earliest tested compatible version. (new pack: version: 1, minAppVersion: 1.2.0)
  • Every declared capability has its required fields and real-site evidence above.
  • Selectors avoid generated classes, broad page containers, and language-specific visible text where a stable attribute exists.
  • Regex, path templates, and CSS stay within the documented safety boundary.
  • The JSON contains no secrets, cookies, tokens, account data, internal URLs, scripts, expressions, or remote resource loading.
  • I reviewed docs/developer/site-adapter/site-pack-review-checklist.md and documented any item that cannot be exercised.

Add a declarative site pack for longcat.chat with outline,
outline-user-queries, export-basic, generation-detect, new-chat,
stop-generation, width, zen, prompt-insert, and reading-history
capabilities.

Selectors use the app's semantic component classes (v-message-list,
v-chat-user-message, v-chat-assistant-message, slider-header, chatInput)
instead of the hashed data-v-* attributes. Conversation ids come from
/c/<id> paths and share pages are recognized under /share/.

conversation-list and model-lock are not declared: sidebar items carry
no conversation id in the DOM, and no model switcher exists in the
captured page.
@github-actions

github-actions Bot commented Aug 14, 2026

Copy link
Copy Markdown

Registry validation failed ❌

Fix the fields reported below and push a new commit.

Validation errors
> ophel@1.2.0 registry:validate /home/runner/work/ophel/ophel
> tsx registry/scripts/validate.mjs "--" "--registry-root" "/home/runner/work/_temp/registry-pr/registry"

[registry] validation failed
Registry validation failed:
sites/longcat.json:$.scrollPinRelease [unknown_key] Unknown key: scrollPinRelease
 ELIFECYCLE  Command failed with exit code 1.

urzeye added 3 commits August 15, 2026 00:55
ReadingHistoryManager started whenever the global persistence setting
was on, ignoring the declared feature capabilities, so community packs
without "reading-history" still recorded and restored scroll
positions. On LongCat AI the restore logic fights outline title jumps:
clicks look dead unless scroll lock is enabled, while scroll to top,
bottom, and anchors keep working.

Gate manager creation on adapter.hasFeatureCapability("reading-history")
in both initReadingHistoryManager and the settings-update path. All 15
built-in sites declare the capability, so their behavior is unchanged.

Also drop the capability from the LongCat AI pack and its 11 locale
descriptions, since that site is where the conflict was observed.
chatContent stays: quick quote, inline bookmarks, and the usage counter
also consume it.
A contenteditable DOM does not preserve newlines in textContent (e.g.
ProseMirror renders each line as its own paragraph), so the strict
editorText.includes(content) check failed for multi-line prompts even
though the text had been inserted, surfacing an "Insert failed" toast
on sites such as LongCat AI.

Compare with all whitespace stripped on both sides instead; textarea
values are unaffected since their text round-trips exactly.
On LongCat AI, clicking an outline title right after a page refresh did
not jump (or snapped back to the bottom) until the user scrolled by
hand or enabled scroll lock. The site's chat scroll composable only
treats wheel/touchmove as "user took over scrolling"; until then a
MutationObserver on the message list keeps calling scrollTo(bottom) on
every DOM change, undoing programmatic scrollIntoView jumps within its
100ms throttle window.

After an outline jump, the declarative adapter now dispatches a
zero-delta wheel event on the scroll container so the host page
disengages its auto-pinning, retrying the jump a few times inside a
short window to cover the throttled yank. Sites without such listeners
see an inert event. Built-in adapters are unaffected.
@urzeye urzeye self-assigned this Aug 15, 2026
@urzeye urzeye added enhancement Feature request or functional improvement adaptation Adaptation to the new dom structure labels Aug 15, 2026
@urzeye urzeye added this to the v1.2.1 milestone Aug 15, 2026
Retries from older outline jumps could fire after a newer jump and drag
the view back, and the zero-delta wheel was dispatched for every
declarative site. Limit the release signal to packs declaring
scrollPinRelease (LongCat only for now), invalidate stale retries with
a jump sequence guard, and stop retrying once the user really scrolls.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

adaptation Adaptation to the new dom structure enhancement Feature request or functional improvement

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

1 participant