Skip to content

aa - #781

Open
brakchen wants to merge 4 commits into
agegr:mainfrom
brakchen:main
Open

aa#781
brakchen wants to merge 4 commits into
agegr:mainfrom
brakchen:main

Conversation

@brakchen

@brakchen brakchen commented Sep 8, 2026

Copy link
Copy Markdown

No description provided.

pi-web-dev and others added 4 commits September 3, 2026 15:23
…r in pi-web

The `@liziy/token-stats` plugin and similar extensions register their
status bar via `ctx.ui.setFooter(factory)`. The pi-web UI adapter had
`setFooter: () => {}` as a no-op, so the entire footer (token usage,
quotas, cwd, model) was dropped silently when those extensions ran in
pi-web.

Map the SDK's `setFooter(factory)` factory onto the existing widget
pipeline pinned to placement "footer":

- `lib/types.ts` / `lib/pi-types.ts`: extend the widget placement
  union with "footer" so `ExtensionWidgetItem` and `WidgetOptionsLike`
  can carry it.
- `lib/rpc-manager.ts`: add `FooterDataProviderLike` (getGitBranch
  returns null, getExtensionStatuses reuses the existing status map,
  onBranchChange is a no-op unsubscribe — pi-web doesn't watch
  .git/HEAD), extend `ExtensionWidgetFactory` to take an optional third
  footerData argument, and route setFooter into the existing widget
  factory path with placement="footer".
- `components/ExtensionWidgets.tsx`: split widgets by placement —
  aboveEditor/belowEditor widgets continue to use the 108px trigger chip
  UX; footer widgets render as a full-width multi-line block with the
  same updating pulse animation.
- `app/globals.css`: add `.extension-footer-widgets` /
  `.extension-footer-widget` styles for the new full-width footer
  area.
- `lib/i18n/messages/{en,zh-CN,zh-TW}.ts`: add labels for the new
  footer widget area.

Also adds a SAFETY: comment to a handful of pre-existing
`as unknown as SessionEntry[]` casts in rpc-manager.ts that the
project's lint self-scan was re-flagging on every edit (these are
SDK SessionManager.getEntries() returning the same entry shape as
SessionEntry[]; no behavior change).
Bulk commit of pre-existing in-progress edits in the working tree:
- File explorer + viewer + icons (large refactor across components/)
- Markdown body / message view tweaks
- Chat window + agent session hooks
- App layout / manifest / next.config / PWA service worker
- lib/request-security, lib/web-push helpers
- lib/command-timeout-prompt.ts, lib/tool-elapsed.ts new helpers
- offline.html, package-lock.json

Companion to the setFooter commit (8fa03a9); see that commit for the
setFooter-specific rationale.
Synced 57 commits from upstream including:
- Readable themes and toolbar theme selector
- Browser password login
- Paginated large text file previews
- Rich-text paste link preservation
- Terminal panel support
- Session search functionality
- Various bug fixes and improvements

Resolved conflicts in:
- app/manifest.ts (basePath preservation)
- components/ChatWindow.tsx (tool elapsed + search block)
- components/FileViewer.tsx (API_BASE_PATH + VideoViewer + pagination)
- components/MarkdownBody.tsx (API_BASE_PATH + shouldOpenLocalFileInApp)
- components/MessageView.tsx (running tool elapsed + search block)
- public/sw.js (BASE_PATH + renotify)
- lib/rpc-manager.ts: PlainTextTheme empty-string colors were stripped
  by the production minifier, causing Theme constructor to crash on
  undefined.startsWith(). Use "#000000" placeholders and provide all
  color keys to prevent minification removal.

- proxy.ts: middleware redirects used new URL() which dropped the
  basePath prefix. Use request.nextUrl.clone() + pathname assignment
  so redirects respect the configured basePath.

- app/login/page.tsx: replace next/image with <img> to avoid
  _next/image optimization failing on basePath; prepend basePath in
  safeDestination() for post-login redirect.

- components/AppShell.tsx: router.replace(window.location.pathname)
  included the basePath, causing double prefix (/pi-web/pi-web) on
  client-side navigation. Use usePathname() which returns the internal
  path without basePath.

- components/SettingsPanel.tsx: logout redirect missing basePath.
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.

1 participant