Skip to content

fix: clear sessionStorage CRUD search state on approval menu switch#605

Draft
Copilot wants to merge 3 commits into6.10from
copilot/fix-search-condition-issue
Draft

fix: clear sessionStorage CRUD search state on approval menu switch#605
Copilot wants to merge 3 commits into6.10from
copilot/fix-search-condition-issue

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 30, 2026

When switching between approval sidebar menus (e.g., "待审核" → "草稿"), CRUD search conditions stored in sessionStorage leak across lists. If a user searches by instance_name in "待审核" then navigates to "草稿" (which lacks that field), the carried-over filter returns empty results.

  • Clear {pathname}/crud and {pathname}/crud/query sessionStorage keys at the top of handleSelect, before any navigation logic runs
const handleSelect: TreeProps['onSelect'] = (keys, info) => {
    const selectedKey = keys[0] as string;
    if (!selectedKey) return;

    try {
      const pathname = window.location.pathname;
      sessionStorage.removeItem(pathname + '/crud');
      sessionStorage.removeItem(pathname + '/crud/query');
    } catch {
      // sessionStorage unavailable
    }
    // ... rest of navigation logic

These are the same keys written by the table API's requestAdaptor in table.js to persist pagination, filters, and sort state across requests within a single list view.


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

…o prevent filter leakage

Agent-Logs-Url: https://github.com/steedos/steedos-widgets/sessions/f4a65a6e-5ed3-4523-a85c-f298faa7e324

Co-authored-by: yinlianghui <6219465+yinlianghui@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix search condition issue when switching approval sidebar menu fix: clear sessionStorage CRUD search state on approval menu switch Mar 30, 2026
Copilot AI requested a review from yinlianghui March 30, 2026 04:15
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.

审批侧栏菜单切换时搜索条件串场问题修复(关联 steedos-plugins#564)

2 participants