feat(site-packs): add LongCat AI site pack - #828
Open
urzeye wants to merge 5 commits into
Open
Conversation
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.
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. |
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.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SitePack contribution / SitePack 贡献
Site / 站点
registry/sites/longcat.jsonlongcatTested environment / 测试环境
Declared and tested capabilities / 已声明并验证的能力
outlineoutline-user-queriesconversation-listexport-basicmodel-lockgeneration-detectnew-chatstop-generationwidthzencleanprompt-insertreading-historyLimitations / 说明:
conversation-listis not declared: sidebar items (.conv-item) carry no conversation id in the DOM (no href/data-*), soidFromcannot be satisfied.model-lockis not declared: no model switcher exists in the captured page.generation-detect/stop-generationrely 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.themeSyncis not declared: the host theme storage mechanism was not verified.reading-historywas 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 onadapter.hasFeatureCapability("reading-history")in bothinitReadingHistoryManagerand the settings-update path. All 15 built-in sites declare the capability, so their behavior is unchanged.chatContentstays in the pack because quick quote, inline bookmarks, and the usage counter also consume it./c/<id>, share pages under/share/<id>, new chat at/.Evidence / 验证证据
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 Vuedata-v-*attributes and localized visible text are deliberately not used.generating.existsSelectors), no network monitor rules.Contributor checklist / 贡献者检查
pnpm registry:validatepasses. (7 SitePacks validated)pnpm registry:buildpasses and I did not commitregistry/dist/.matchesare HTTPS, narrow, and do not overlap built-in or existing packs.versionwas incremented for an update, andminAppVersionis the earliest tested compatible version. (new pack:version: 1,minAppVersion: 1.2.0)docs/developer/site-adapter/site-pack-review-checklist.mdand documented any item that cannot be exercised.