[PR #6672] [MERGED] fix(home): let any package widget open one item in its own tab #7281

Closed
opened 2026-10-23 04:18:14 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/6672
Author: @Gunterlie
Created: 9/25/2026
Status: ✅ Merged
Merged: 9/25/2026
Merged by: @Gunterlie

Base: staging ← Head: fix/widget-open-post-any-package


📝 Commits (5)

  • fda66bf fix(home): let any package widget open one item in its own tab
  • ef29218 docs(packages): document agent Home widgets (Capability API 1.35)
  • 9da432a fix(home): ignore widget tab callbacks when the package has no Home tab
  • 7c9f2b3 fix(home): clear only the widget focus request the tab handled
  • 4c46967 Merge remote-tracking branch 'origin/staging' into fix/widget-open-post-any-package

📊 Changes

3 files changed (+80 additions, -9 deletions)

View changed files

📝 CHANGELOG.md (+2 -0)
📝 docs/development/optional-agent-packages.md (+65 -0)
📝 packages/client/src/components/chat/HomeBrowserHub.tsx (+13 -9)

📄 Description

Why

Agent Home widgets (#6627) give package widgets an onOpenPost(id) callback, but the Engine accepted it only from the noodle package and passed focusPostId only to the Noodle tab. Any other agent's widget could open its tab (onOpenNoodle()), but could not jump to one item in it. Agent authors had to change the Engine for a feature that looks generic.

No linked issue. This is a small follow-up to #6627; an issue can be opened if a reviewer wants one.

What

  • HomeBrowserHub.tsx: the focused item now stores { packageId, postId }. onOpenPost works for any package widget and opens that widget's own tab. The tab receives focusPostId only when it is the tab of the package that set it.
  • selectTab clears the focus with a functional update, so the focus that onOpenPost sets in the same handler is kept.
  • onOpenPost and onOpenNoodle do nothing when the package has no Home browser tab (local CodeRabbit finding), so a widget cannot switch Home to a tab that does not exist.
  • Noodle behaves as before. The prop names (onOpenPost, focusPostId, onFocusPostHandled, onOpenNoodle) do not change, so no package needs an update.

Docs

  • docs/development/optional-agent-packages.md: new section Capability API 1.35: agent Home widgets. #6627 shipped the widget contract without builder docs. The section covers the manifest fields, the install rules, and the view="widget" props, including the now-generic onOpenPost.
  • Translated docs follow-up: #6673.

Manual verification

  • Manually verify that clicking a post in Noodle's Latest Posts widget opens the Noodle tab at that post.
  • Manually verify that a non-Noodle test package widget that calls onOpenPost("x") opens its own Home tab and receives focusPostId: "x".
  • Read the new docs section and check it against a real package manifest (for example Noodle 1.2.25).
  • Manually verify that switching to another tab after onOpenPost clears the focus (going back does not jump again).

Summary by CodeRabbit

  • New Features
    • Agent package Home widgets can open items in their own Home tab, extending this capability beyond Noodle.
  • Documentation
    • Added guidance on agent Home widget requirements, widget limits, and navigation options.
  • Bug Fixes
    • Item navigation requests are validated and only target packages available in the Home browser. Selecting the package that owns a pending item keeps that navigation available; selecting a different package clears it. A handled navigation request also clears its pending item.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/6672 **Author:** [@Gunterlie](https://github.com/Gunterlie) **Created:** 9/25/2026 **Status:** ✅ Merged **Merged:** 9/25/2026 **Merged by:** [@Gunterlie](https://github.com/Gunterlie) **Base:** `staging` ← **Head:** `fix/widget-open-post-any-package` --- ### 📝 Commits (5) - [`fda66bf`](https://github.com/Pasta-Devs/Marinara-Engine/commit/fda66bfa002512641ef943c9c5e864fed784ab70) fix(home): let any package widget open one item in its own tab - [`ef29218`](https://github.com/Pasta-Devs/Marinara-Engine/commit/ef292186fc70962c6cfd7b8582e68dac8beba2c8) docs(packages): document agent Home widgets (Capability API 1.35) - [`9da432a`](https://github.com/Pasta-Devs/Marinara-Engine/commit/9da432ac9d26d0faf4513b73300f2ef98f276710) fix(home): ignore widget tab callbacks when the package has no Home tab - [`7c9f2b3`](https://github.com/Pasta-Devs/Marinara-Engine/commit/7c9f2b3da59171bc56554c6f7a8211ea31a66d03) fix(home): clear only the widget focus request the tab handled - [`4c46967`](https://github.com/Pasta-Devs/Marinara-Engine/commit/4c46967c929f69a1486aec4bd0510276779723e6) Merge remote-tracking branch 'origin/staging' into fix/widget-open-post-any-package ### 📊 Changes **3 files changed** (+80 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+2 -0) 📝 `docs/development/optional-agent-packages.md` (+65 -0) 📝 `packages/client/src/components/chat/HomeBrowserHub.tsx` (+13 -9) </details> ### 📄 Description ## Why Agent Home widgets (#6627) give package widgets an `onOpenPost(id)` callback, but the Engine accepted it only from the `noodle` package and passed `focusPostId` only to the Noodle tab. Any other agent's widget could open its tab (`onOpenNoodle()`), but could not jump to one item in it. Agent authors had to change the Engine for a feature that looks generic. No linked issue. This is a small follow-up to #6627; an issue can be opened if a reviewer wants one. ## What - `HomeBrowserHub.tsx`: the focused item now stores `{ packageId, postId }`. `onOpenPost` works for any package widget and opens that widget's own tab. The tab receives `focusPostId` only when it is the tab of the package that set it. - `selectTab` clears the focus with a functional update, so the focus that `onOpenPost` sets in the same handler is kept. - `onOpenPost` and `onOpenNoodle` do nothing when the package has no Home browser tab (local CodeRabbit finding), so a widget cannot switch Home to a tab that does not exist. - Noodle behaves as before. The prop names (`onOpenPost`, `focusPostId`, `onFocusPostHandled`, `onOpenNoodle`) do not change, so no package needs an update. ## Docs - `docs/development/optional-agent-packages.md`: new section **Capability API 1.35: agent Home widgets**. #6627 shipped the widget contract without builder docs. The section covers the manifest fields, the install rules, and the `view="widget"` props, including the now-generic `onOpenPost`. - Translated docs follow-up: #6673. ## Manual verification - [ ] Manually verify that clicking a post in Noodle's Latest Posts widget opens the Noodle tab at that post. - [ ] Manually verify that a non-Noodle test package widget that calls `onOpenPost("x")` opens its own Home tab and receives `focusPostId: "x"`. - [ ] Read the new docs section and check it against a real package manifest (for example Noodle 1.2.25). - [ ] Manually verify that switching to another tab after `onOpenPost` clears the focus (going back does not jump again). <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Agent package Home widgets can open items in their own Home tab, extending this capability beyond Noodle. * **Documentation** * Added guidance on agent Home widget requirements, widget limits, and navigation options. * **Bug Fixes** * Item navigation requests are validated and only target packages available in the Home browser. Selecting the package that owns a pending item keeps that navigation available; selecting a different package clears it. A handled navigation request also clears its pending item. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-23 04:18:14 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#7281
No description provided.