Skip to content

feat: skip useInaliaQuestion fetches when Inalia is in static mode#44

Merged
Barbapapazes merged 4 commits into
mainfrom
copilot/fix-useinaliaquestion-fetch-logic
Apr 12, 2026
Merged

feat: skip useInaliaQuestion fetches when Inalia is in static mode#44
Barbapapazes merged 4 commits into
mainfrom
copilot/fix-useinaliaquestion-fetch-logic

Conversation

Copilot AI commented Apr 10, 2026

Copy link
Copy Markdown
Contributor
  • Inspect the review feedback, current useInaliaQuestion changes, and the new useInaliaStatus composable to determine the minimal update.
  • Update useInaliaQuestion to rely on useInaliaStatus instead of manually injecting talk state.
  • Adjust and extend the focused composable tests to cover the reviewed behavior.
  • Run targeted validation for the changed files, then review the final diff.
  • Reply to actionable review comments with the addressing commit hash.

Agent-Logs-Url: https://github.com/Inalia-App/slidev-addon-inalia/sessions/e171bc80-8b66-4840-af6f-40694a85f269

Co-authored-by: Barbapapazes <45267552+Barbapapazes@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix useInaliaQuestion to resolve without fetching when data is missing Skip useInaliaQuestion fetches when Inalia is in static mode Apr 10, 2026
Copilot AI requested a review from Barbapapazes April 10, 2026 21:28
@Barbapapazes

Copy link
Copy Markdown
Contributor

waiting for #45 for a proper implementation.

@Barbapapazes Barbapapazes changed the title Skip useInaliaQuestion fetches when Inalia is in static mode feat: skip useInaliaQuestion fetches when Inalia is in static mode Apr 12, 2026

@Barbapapazes Barbapapazes left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

use comments and update tests.

Comment thread composables/useInaliaQuestion.ts Outdated
export function useInaliaQuestion(defaultQuestionId: MaybeRefOrGetter<number | undefined>, options?: UseInaliaQuestionOptions): Inalia {
const { staticContent } = options || {}

const talk = inject<Talk | null>('talk', null)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Use the new useInaliaStatus, instead of manually injecting the talk.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Updated in 918e206 to use useInaliaStatus() in useInaliaQuestion, and revalidated the composable/tests.

@pkg-pr-new

pkg-pr-new Bot commented Apr 12, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/Inalia-App/slidev-addon-inalia@44

commit: 918e206

@Barbapapazes Barbapapazes marked this pull request as ready for review April 12, 2026 13:37
Copilot AI review requested due to automatic review settings April 12, 2026 13:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR prevents useInaliaQuestion from attempting dynamic question fetching (and related real-time subscriptions) when the addon is effectively in “static mode” because no talk is available via injection.

Changes:

  • Inject talk into useInaliaQuestion and short-circuit fetch logic on mount, on questionId changes, and inside fetch() when talk is null.
  • Extend the composable test harness to provide a default talk (to preserve existing dynamic-path tests) and add a regression test for talk: null.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
composables/useInaliaQuestion.ts Adds injected talk gating to skip fetch/subscription work when talk is unavailable.
tests/composables/useInaliaQuestion.spec.ts Provides talk via test mounting and adds coverage ensuring no fetch/Echo subscription when talk is null.

Copilot AI commented Apr 12, 2026

Copy link
Copy Markdown
Contributor Author

use comments and update tests.

Addressed in 918e206: the implementation now follows the review comments, and the focused useInaliaQuestion tests were updated to cover the static-mode path.

@Barbapapazes Barbapapazes merged commit d8634f9 into main Apr 12, 2026
6 checks passed
@Barbapapazes Barbapapazes deleted the copilot/fix-useinaliaquestion-fetch-logic branch April 12, 2026 13:43
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.

useInaliaQuestion always triggers a fetch

3 participants