Skip to content

feat: integrate quiz actions with chat composer#95

Merged
urjitc merged 1 commit into
mainfrom
feature/no-ref/quiz-actions-integration
Jan 21, 2026
Merged

feat: integrate quiz actions with chat composer#95
urjitc merged 1 commit into
mainfrom
feature/no-ref/quiz-actions-integration

Conversation

@urjitc

@urjitc urjitc commented Jan 21, 2026

Copy link
Copy Markdown
Member
  • Update quiz actions in sidebar, create menu, and context menu to open chat panel
  • Fill composer input with 'Create a quiz about ' when quiz action is triggered
  • Focus composer input after setting text for better UX
  • Reorganize menus: create 'Learn' submenu with Flashcards and Quiz
  • Move YouTube and Deep Research to 'Other' submenu
  • Update icons to match SidebarQuickActions (LuBook for Learn, PiCardsThreeFill for Flashcards)

Important

Integrate quiz actions with chat composer, reorganize menus, and update icons in SidebarQuickActions.tsx, WorkspaceHeader.tsx, and WorkspaceSection.tsx.

  • Behavior:
    • Quiz actions in SidebarQuickActions.tsx, WorkspaceHeader.tsx, and WorkspaceSection.tsx now open the chat panel and fill the composer input with 'Create a quiz about '.
    • Composer input is focused after setting text for improved UX.
  • Menus:
    • Reorganize menus to include a 'Learn' submenu with Flashcards and Quiz.
    • Move YouTube and Deep Research to an 'Other' submenu.
  • Icons:
    • Update icons to LuBook for Learn and PiCardsThreeFill for Flashcards in WorkspaceHeader.tsx and WorkspaceSection.tsx.

This description was created by Ellipsis for 799fbec. You can customize this summary. It will automatically update as commits are pushed.

Summary by CodeRabbit

Release Notes

  • New Features
    • Added Quiz creation option accessible from workspace menus and quick action panels
    • Quiz creation now automatically opens the chat and pre-fills the assistant with a quiz prompt for streamlined workflow
    • Updated visual icons for Learn and Flashcards sections for improved clarity

✏️ Tip: You can customize this high-level summary in your review settings.

- Update quiz actions in sidebar, create menu, and context menu to open chat panel
- Fill composer input with 'Create a quiz about ' when quiz action is triggered
- Focus composer input after setting text for better UX
- Reorganize menus: create 'Learn' submenu with Flashcards and Quiz
- Move YouTube and Deep Research to 'Other' submenu
- Update icons to match SidebarQuickActions (LuBook for Learn, PiCardsThreeFill for Flashcards)
@vercel

vercel Bot commented Jan 21, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
thinkex Ready Ready Preview, Comment Jan 21, 2026 8:06pm

@coderabbitai

coderabbitai Bot commented Jan 21, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

Three workspace canvas components now support quiz creation through consistent user actions. Each component imports a composer utility to open the chat, pre-fill a quiz prompt, focus the input field, and display a success notification when users trigger the new Quiz action.

Changes

Cohort / File(s) Change Summary
Quiz Feature Implementation across Workspace Components
src/components/workspace-canvas/SidebarQuickActions.tsx, src/components/workspace-canvas/WorkspaceHeader.tsx, src/components/workspace-canvas/WorkspaceSection.tsx
Adds Quiz action handler to open chat, populate composer with "Create a quiz about " prompt, focus composer input via imported focusComposerInput utility, and show success toast. Updates menu icons (Brain, LuBook, PiCardsThreeFill) and restructures Learn/Flashcards menu items across sidebar, header, and section components.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 A quiz now springs from three component lands,
Where chat opens wide at the Quiz creator's hands,
With prompts pre-filled and focus set true,
The composer awaits—what knowledge to brew? ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main change: integrating quiz actions with the chat composer functionality across multiple components.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Comment @coderabbitai help to get the list of available commands and usage tips.

@sonarqubecloud

Copy link
Copy Markdown

@ellipsis-dev ellipsis-dev Bot 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.

Important

Looks good to me! 👍

Reviewed everything up to 799fbec in 1 minute and 29 seconds. Click for details.
  • Reviewed 173 lines of code in 3 files
  • Skipped 0 files when reviewing.
  • Skipped posting 3 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. src/components/workspace-canvas/SidebarQuickActions.tsx:94
  • Draft comment:
    The quiz creation logic (open chat, set composer text, focus input, toast) is duplicated here. Consider extracting it into a shared helper to improve consistency and reduce code repetition. Also, using optional chaining (e.g. api?.composer()) might help make the code more robust.
  • Reason this comment was not posted:
    Confidence changes required: 50% <= threshold 50% None
2. src/components/workspace-canvas/WorkspaceHeader.tsx:675
  • Draft comment:
    The quiz action onClick handler repeats the same logic seen elsewhere (open chat, set composer text, focus input, toast). Extracting this functionality into a common function would improve maintainability. Also, ensure consistent use of optional chaining for api calls.
  • Reason this comment was not posted:
    Confidence changes required: 50% <= threshold 50% None
3. src/components/workspace-canvas/WorkspaceSection.tsx:579
  • Draft comment:
    The quiz creation logic is duplicated here as well. Consider refactoring it into a shared helper to reduce redundancy and potential inconsistencies (e.g., ordering of chat expansion vs. toast). Consistent handling (including optional chaining for api) would improve readability and maintainability.
  • Reason this comment was not posted:
    Confidence changes required: 50% <= threshold 50% None

Workflow ID: wflow_c8j1aLKDRoHNWtWh

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

import type React from "react";
import { useState, useRef, useEffect, useCallback } from "react";
import { Search, X, ChevronRight, ChevronDown, FolderOpen, ChevronLeft, Plus, Upload, Layers, FileText, Folder, Settings, Share2, Play, MoreHorizontal, Globe } from "lucide-react";
import { Search, X, ChevronRight, ChevronDown, FolderOpen, ChevronLeft, Plus, Upload, Layers, FileText, Folder, Settings, Share2, Play, MoreHorizontal, Globe, Brain } from "lucide-react";
} from "@/components/ui/context-menu";

import { FileText, Layers, Folder, Upload, Play, Plus, MoreHorizontal, Globe } from "lucide-react";
import { FileText, Layers, Folder, Upload, Play, Plus, MoreHorizontal, Globe, Brain } from "lucide-react";

@cubic-dev-ai cubic-dev-ai Bot 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.

No issues found across 3 files

@greptile-apps

greptile-apps Bot commented Jan 21, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Integrated quiz creation functionality with the chat composer across three UI components (sidebar, header dropdown, and context menu). When users click the quiz action, it opens the chat panel and pre-fills the composer with "Create a quiz about " to streamline the workflow.

Key changes:

  • Reorganized menus to create a "Learn" submenu containing Flashcards and Quiz options
  • Moved YouTube and Deep Research to a separate "Other" submenu for better organization
  • Updated icons to LuBook for Learn and PiCardsThreeFill for Flashcards across all components
  • Implemented focusComposerInput() utility to focus the composer input after setting text
  • Removed toast.info("Quizzes coming soon!") in favor of functional implementation

The implementation is consistent across all three files and follows existing patterns for similar actions like Deep Research.

Confidence Score: 4/5

  • Safe to merge with minor runtime error risk in WorkspaceHeader.tsx
  • The implementation is well-structured and consistent across all files. However, there are logical errors in WorkspaceHeader.tsx where optional chaining is incorrectly applied to api?.composer().setText() - if api is undefined, this will still throw a runtime error. The other two files correctly use api.composer() without optional chaining.
  • src/components/workspace-canvas/WorkspaceHeader.tsx requires fixing the optional chaining issues on lines 682 and 713

Important Files Changed

Filename Overview
src/components/workspace-canvas/SidebarQuickActions.tsx Implements quiz action that opens chat, sets composer text to 'Create a quiz about ', and focuses input. Implementation is consistent with other actions in the file.
src/components/workspace-canvas/WorkspaceHeader.tsx Reorganizes menu structure with new 'Learn' submenu containing Flashcards and Quiz. Updates icons to match SidebarQuickActions. Uses optional chaining for api which could cause runtime error if undefined.
src/components/workspace-canvas/WorkspaceSection.tsx Adds quiz functionality to context menu with consistent implementation. Properly handles desktop check before expanding chat. No issues found.

Sequence Diagram

sequenceDiagram
    participant User
    participant Menu as Menu/Sidebar/Context
    participant Handler as Quiz Handler
    participant Chat as Chat Panel
    participant Composer as Composer API
    participant Input as Composer Input

    User->>Menu: Click Quiz Action
    Menu->>Handler: handleQuizClick()
    
    alt Chat is not expanded
        Handler->>Chat: setIsChatExpanded(true)
        Chat-->>Handler: Opens chat panel
    end
    
    Handler->>Composer: api.composer().setText("Create a quiz about ")
    Composer-->>Input: Sets text in composer
    
    Handler->>Input: focusComposerInput()
    Note over Input: setTimeout 100ms
    Input-->>Input: Focus composer textarea
    
    Handler->>User: toast.success("Quiz creation started")
    User-->>Input: Types quiz topic
Loading

@greptile-apps greptile-apps Bot 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.

Additional Comments (1)

  1. src/components/workspace-canvas/WorkspaceHeader.tsx, line 713 (link)

    logic: same issue as line 682 - optional chaining doesn't prevent error when calling .setText() on undefined

3 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

setIsChatExpanded(true);
}
// Fill composer with quiz creation prompt
api?.composer().setText("Create a quiz about ");

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.

logic: optional chaining on api doesn't prevent the error - if api is undefined, api?.composer() returns undefined, then calling .setText() on undefined throws an error

Suggested change
api?.composer().setText("Create a quiz about ");
api.composer().setText("Create a quiz about ");
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/components/workspace-canvas/WorkspaceHeader.tsx
Line: 682:682

Comment:
**logic:** optional chaining on `api` doesn't prevent the error - if `api` is undefined, `api?.composer()` returns undefined, then calling `.setText()` on undefined throws an error

```suggestion
                        api.composer().setText("Create a quiz about ");
```

How can I resolve this? If you propose a fix, please make it concise.

@urjitc
urjitc merged commit a96a87c into main Jan 21, 2026
9 checks passed
@urjitc
urjitc deleted the feature/no-ref/quiz-actions-integration branch January 21, 2026 20:36
@github-project-automation github-project-automation Bot moved this from Backlog to Done in Dev Board Jan 21, 2026
@coderabbitai coderabbitai Bot mentioned this pull request Feb 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant