Skip to content

fix(ui): 本会话内延后提供商配置提示#68

Merged
appergb merged 1 commit into
Open-Less:mainfrom
Cooper-X-Oak:codex/provider-setup-session-pr
Apr 30, 2026
Merged

fix(ui): 本会话内延后提供商配置提示#68
appergb merged 1 commit into
Open-Less:mainfrom
Cooper-X-Oak:codex/provider-setup-session-pr

Conversation

@Cooper-X-Oak
Copy link
Copy Markdown
Contributor

@Cooper-X-Oak Cooper-X-Oak commented Apr 30, 2026

摘要

关联 fork 验证:Cooper-X-Oak#12

本 PR 是从 fork/dev 已验证批次拆出的 UI 状态修复:提供商配置提示不再用 localStorage 永久记住“已看过”,而是只在本 session 内延后,避免用户未完成配置后后续启动再也不提示。

fork/dev 先行验证

修复 / 新增 / 改进

  • PROVIDER_SETUP_PROMPT_SEEN_KEY 改为 PROVIDER_SETUP_PROMPT_DEFERRED_KEY
  • provider prompt 状态从 localStorage 改为 sessionStorage
  • “稍后”只在当前会话内延后提示,下次启动若凭据仍未配置会再次提示。
  • 更新 providerSetup 测试文案,明确 deferred 语义。

兼容

  • 不包含:启动路径、热键 core、ASR、插入 fallback、权限状态、凭据字段保存。
  • 对现有用户 / 本地环境 / 构建流程的影响:只影响未配置 provider 时的提示频率;不会读写真实凭据。

测试计划

Summary by Sourcery

Limit provider setup prompts to be deferred only within the current session instead of being permanently suppressed.

Enhancements:

  • Switch provider setup prompt state from localStorage to sessionStorage using a new deferred-key name and semantics.
  • Clarify provider setup test description to reflect session-scoped deferral of the prompt.

@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented Apr 30, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Updates the provider setup reminder so that deferring the prompt is tracked only for the current session via sessionStorage, instead of persisting a "seen" state in localStorage, and refreshes the associated key name and test wording accordingly.

Sequence diagram for provider setup prompt using sessionStorage

sequenceDiagram
  actor User
  participant App
  participant FloatingShellBody
  participant CredentialStore
  participant SessionStorage
  participant ProviderSetup

  User->>App: Launch app
  App->>FloatingShellBody: Mount component
  FloatingShellBody->>CredentialStore: getCredentials()
  CredentialStore-->>FloatingShellBody: CredentialsStatus
  FloatingShellBody->>SessionStorage: getItem(PROVIDER_SETUP_PROMPT_DEFERRED_KEY)
  SessionStorage-->>FloatingShellBody: promptDeferredValue
  FloatingShellBody->>ProviderSetup: shouldShowProviderSetupPrompt(credentials, promptDeferredValue)
  ProviderSetup-->>FloatingShellBody: boolean
  alt Prompt should be shown
    FloatingShellBody-->>User: Show provider setup prompt
    User->>FloatingShellBody: Click defer button
    FloatingShellBody->>SessionStorage: setItem(PROVIDER_SETUP_PROMPT_DEFERRED_KEY, 1)
    FloatingShellBody-->>User: Close prompt
  else Prompt should not be shown
    FloatingShellBody-->>User: No provider prompt this session
  end
Loading

File-Level Changes

Change Details Files
Track provider setup prompt deferral in sessionStorage for the current session instead of persisting a seen state in localStorage.
  • Replace localStorage access with sessionStorage when reading the provider setup prompt state on shell initialization.
  • Replace localStorage access with sessionStorage when persisting the provider setup prompt state after the user chooses to defer.
  • Rename the storage key constant to reflect session-scoped deferral semantics and update its value string.
openless-all/app/src/components/FloatingShell.tsx
openless-all/app/src/lib/providerSetup.ts
Align provider-setup logic and tests with the new deferred-this-session semantics.
  • Update shouldShowProviderSetupPrompt parameter naming and logic to use the new deferred value instead of seen value.
  • Adjust the providerSetup test description to state that the prompt is not repeated after being deferred in the current session.
openless-all/app/src/lib/providerSetup.ts
openless-all/app/src/lib/providerSetup.test.ts

Possibly linked issues

  • #[settings] 提供商未配置提示被永久压住: PR switches prompt state to session-only deferral, ensuring users see provider setup again while unconfigured

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've left some high level feedback:

  • Since the storage key has been renamed and moved from localStorage to sessionStorage, consider cleaning up the old ol.providerSetupPromptSeen entry (e.g., on first run after upgrade) to avoid leaving stale keys around in existing installations.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Since the storage key has been renamed and moved from localStorage to sessionStorage, consider cleaning up the old `ol.providerSetupPromptSeen` entry (e.g., on first run after upgrade) to avoid leaving stale keys around in existing installations.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@appergb appergb merged commit 8de575d into Open-Less:main Apr 30, 2026
2 checks passed
appergb pushed a commit that referenced this pull request Apr 30, 2026
包含本轮所有合并:
- Codex 终审两条 HIGH (cancel race) 修复 (PR #79)
- 6 个 Cooper-X-Oak/Codex bot PRs 自动合并 (#44 #49 #53 #68 #72 #73)
- 2 个有冲突 PR 本地 rebase 后合并 (#66 cancel + 空转写并存 / #67 Windows docs)
- README 破图修复 (PR #80)
- workflow-scope 受限的 #48 + #75 由用户在 GitHub UI 直接合并

3 处版本字段同步:package.json + tauri.conf.json + Cargo.toml
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.

2 participants