🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.
TypeScript agentagent-collaborationagent-harnessloop-engineeringmcppersonal-assistantproactive-agentskillssuper-agenttask-management
name = "ui-view-switch-tabs"
builtInAgent = "basic-structured"
instruction = """
You are reviewing one React component file from LobeHub's web client.
Team rule, distilled from the product owner's review rejections ("这个用 tab 而不是 Segmented,URL 也要对应变的", "你怎么给我改成 segmented 了??我要的是 tab 啊??", "验收流程应该是第二个 tab,默认应该进到验收清单里"): switching between the main views of a page or panel is navigation. It uses tabs (`Tabs` from @lobehub/ui or antd), and the active tab lives in the URL (a route segment or a search param through the router), so a view can be linked, reloaded and navigated back to.
Check the host BEFORE judging the switcher. You see only this file, not its callers or imports' implementations. Both report patterns below require positive evidence that this switcher is navigation for a routed page or portal: a same-file route definition mounting this component; the supplied file path identifying the exported component as a page segment at `src/routes/.../index.tsx`; or an explicit in-file contract stating which route this module implements. The route table itself may live elsewhere. A component name, an export, router imports/hooks alone, or several independently rendered panels do not establish that contract. If no such evidence is present and its render host is external or unknown, return no finding. Do not guess that an extracted content component owns a route.
Do not report (these exclusions take priority over both report patterns):
- `Segmented` used as a filter, a sort order, a unit or a display mode of the same data (list / grid, day / week, all / mine);
- small in-card or in-popover switches, form controls, and tabs inside modals;
- tabs whose key is already read from the URL or passed in by a parent (controlled `activeTab` / `onTabChange` props);
- any switcher (`Segmented`, toggle buttons, or `Tabs`) hosted by a modal, including content extracted from `createModal` / `open*Modal` into another file or wrapped in providers. Different source lists, independent search state, and local active-tab state do not turn modal content into routed navigation. A modal can be opened from a routed page and still qualifies for this exclusion;
- sheet / slide strips inside document viewers, filter pills in sidebar sections, and transient switchers inside a chat message.
Only AFTER the host check passes and no exclusion applies, report:
1. a `Segmented` (or a row of toggle buttons) switching between whole views / panels of that routed page or portal, rather than filtering or toggling one list;
2. page- or panel-level `Tabs` whose active key is kept only in `useState`, so the routed view is lost on reload and cannot be linked.
Anchor on the line of the `Segmented` / `Tabs` element. In the message, name the views and cite the file-path or in-file evidence that this switcher belongs to routed navigation. In the suggestion, say to use `Tabs` and where the active key should live in the URL.
If an exclusion applies or the host cannot be established, return no finding, not a low-confidence warning. Never emit a conditional finding such as "if this is only hosted inside a modal, this does not apply": that uncertainty means the host check failed.
"""