Skip to content

template setting styling#1592

Merged
yujonglee merged 5 commits intomainfrom
jj-branch-25
Oct 23, 2025
Merged

template setting styling#1592
yujonglee merged 5 commits intomainfrom
jj-branch-25

Conversation

@ComputelessComputer
Copy link
Collaborator

No description provided.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 22, 2025

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

This PR refactors the template editing system by introducing navigation-based template selection, restructuring the template editor with a new sections list component, and adding filter/search UI to both the integrations and templates settings pages. Icon props are simplified in the floating listen component.

Changes

Cohort / File(s) Change Summary
Icon prop updates
apps/desktop/src/components/main/body/sessions/floating/listen.tsx
Replaced className="w-5 h-5" with size={20} across four icon instances (zoom, Google Meet, Webex, Microsoft Teams) for consistent dimension specification.
Integrations filtering
apps/desktop/src/components/settings/integrations.tsx
Added ButtonGroup filter UI with All/Installed/Not Installed options; introduced FilterStatus type; implemented status-based filtering logic in useMemo alongside existing search functionality; updated dependency array and heading styling.
Template editor restructuring
apps/desktop/src/components/settings/template/editor.tsx
Replaced form-based editor with simplified version using useUpdateTemplate hook and SectionsList component; removed form management logic; changed signature from { id, onClose } to { id } only; reorganized UI to title input, description textarea, and sections list.
Template sections list (new)
apps/desktop/src/components/settings/template/sections-list.tsx
New file adding SectionsList and SectionItem components with drag-and-drop reordering, add/delete item support, and per-item editing (title/description) with unique ID generation and state change callbacks.
Templates main page refactoring
apps/desktop/src/components/settings/template/index.tsx
Added navigation-based rendering with SettingsTemplatesProps and navigate prop; replaced local state with persisted.UI.useResultTable; introduced search query and FilterStatus ("all" | "favorite") states with corresponding UI controls; added template selection via navigation; replaced static header with dynamic layout including empty state with BookText icon; updated TemplateCard styling.
Settings layout integration
apps/desktop/src/routes/app/settings/_layout.index.tsx
Added Route.useNavigate() hook; passed navigate prop to SettingsTemplates component when rendering templates tab.
Settings layout with template editing
apps/desktop/src/routes/app/settings/_layout.tsx
Added template editing flow with TemplateEditorHeader component providing inline title editing, back navigation, and dropdown actions (Duplicate, Delete); introduced templateId to route's validateSearch schema (optional string); added Create Template action to main header; wired placeholder handlers for template operations.

Sequence Diagram

sequenceDiagram
    participant User
    participant SettingsLayout as Settings Layout
    participant TemplatesPage as Templates Page
    participant TemplateEditor as Template Editor
    participant SectionsList as Sections List

    User->>SettingsLayout: Navigate to Templates tab
    SettingsLayout->>TemplatesPage: Render with navigate prop
    TemplatesPage->>TemplatesPage: Render template list/search
    
    User->>TemplatesPage: Click template card
    TemplatesPage->>SettingsLayout: navigate({search: {templateId}})
    SettingsLayout->>SettingsLayout: Detect templateId in search
    SettingsLayout->>TemplateEditor: Render TemplateEditor(id)
    
    User->>TemplateEditor: Edit template
    TemplateEditor->>SectionsList: Render sections
    
    User->>SectionsList: Reorder/edit/add sections
    SectionsList->>SectionsList: Update local items + IDs
    SectionsList->>TemplateEditor: onChange(sections)
    TemplateEditor->>TemplateEditor: Update template state
    
    User->>TemplateEditor: Click back
    TemplateEditor->>SettingsLayout: Navigation back
    SettingsLayout->>SettingsLayout: Clear templateId
    SettingsLayout->>TemplatesPage: Render template list
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

The changes span multiple files with mixed complexity: signature changes to exported components (TemplateEditor, SettingsTemplates), new component additions (SectionsList), refactored state management and filtering logic (integrations, templates), and navigation integration. While individual cohorts follow consistent patterns, each requires separate reasoning—particularly the template system restructuring which affects both component signatures and public API contracts.

Possibly related PRs

  • template setting styling #1592: Directly overlaps with this PR on multiple files (template components, SectionsList, TemplateEditor signature changes, route validateSearch, and icon prop updates in listen.tsx)
  • General settings improvements #1587: Modifies the same settings layout file (_layout.tsx), affecting settings navigation and template-related rendering
  • Template Selector Merge  #1089: Related to template feature surface changes—template selector and navigation prop additions to SettingsTemplates that this PR introduces

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Title Check ⚠️ Warning The pull request title "template setting styling" is partially related to the changeset as it refers to template settings, which are indeed modified in this PR. However, the title significantly misrepresents the primary nature of the changes. The substantial modifications include: adding new filtering functionality with ButtonGroup components, complete restructuring of the template editor with a new simplified component architecture, introducing a new SectionsList component for interactive section management, modifying public API signatures for TemplateEditor and SettingsTemplates, and implementing navigation-based template editing. While some styling adjustments are present (ButtonGroup styling, TemplateCard layout changes, container spacing), these are secondary to the major feature additions and architectural refactoring. A teammate scanning the repository history would likely misunderstand the scope of work, expecting primarily cosmetic changes rather than significant feature additions and structural changes. Consider revising the title to accurately reflect the primary changes, such as "Add template filtering and restructure template editor UI" or "Enhance template settings with filtering and new sections editor". This would better communicate to reviewers and future developers that the PR involves substantial feature additions and architectural changes beyond cosmetic styling improvements.
Description Check ❓ Inconclusive No pull request description was provided by the author. The description field is empty, which means there is no accompanying explanation of the changes, motivation, or implementation details. Without any description content, it is impossible to evaluate whether the description relates to, or provides context for, the changeset.

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1ef803f and d0fed54.

📒 Files selected for processing (7)
  • apps/desktop/src/components/main/body/sessions/floating/listen.tsx (4 hunks)
  • apps/desktop/src/components/settings/integrations.tsx (3 hunks)
  • apps/desktop/src/components/settings/template/editor.tsx (1 hunks)
  • apps/desktop/src/components/settings/template/index.tsx (2 hunks)
  • apps/desktop/src/components/settings/template/sections-list.tsx (1 hunks)
  • apps/desktop/src/routes/app/settings/_layout.index.tsx (2 hunks)
  • apps/desktop/src/routes/app/settings/_layout.tsx (5 hunks)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (6)
apps/desktop/src/components/main/body/sessions/floating/listen.tsx (1)

131-131: Consider standardizing icon sizing in DuringMeetingButton.

Line 131 still uses className="w-5 h-5 mt-1.5" for the stop icon. For consistency with the refactored icons above, consider extracting the margin utility separately or updating this to use the size prop as well (note: this is out of scope for the current PR but worth addressing in a follow-up).

apps/desktop/src/components/settings/template/editor.tsx (1)

9-11: Use explicit type instead of any.

The sections parameter is typed as any[]. Consider using the persisted.TemplateSection type for better type safety.

Apply this diff:

-  const handleSectionsChange = (sections: any[]) => {
+  const handleSectionsChange = (sections: (persisted.TemplateSection & { id: string })[]) => {
     handle.setField("sections", sections.map(({ id, ...rest }) => rest));
   };
apps/desktop/src/routes/app/settings/_layout.tsx (2)

62-65: Placeholder implementation for creating templates.

The create template logic is not yet implemented. This should be completed before the PR is merged to provide a full feature.

Do you want me to help generate the create template implementation, or would you like me to open an issue to track this work?


234-243: Placeholder implementations for duplicate and delete actions.

Both handlers are incomplete. The delete action should include a confirmation dialog to prevent accidental deletions.

Would you like me to generate the implementation for these actions, including a confirmation dialog for delete?

apps/desktop/src/components/settings/template/index.tsx (1)

23-26: Consider improving type safety.

The double type cast (as unknown as Record<string, persisted.Template>) suggests a type mismatch between TinyBase's return type and the expected template structure. While this might be necessary for the current integration, consider adding proper type definitions to TinyBase queries or creating a typed wrapper to avoid unsafe casts.

apps/desktop/src/components/settings/template/sections-list.tsx (1)

95-122: Type dragControls properly.

The dragControls prop is typed as any on line 100. Use the proper type from the motion library for better type safety.

Apply this diff:

+import type { DragControls } from "motion/react";
+
 interface SectionItemProps {
   disabled: boolean;
   item: ReorderItem & { id: string };
   onChange: (item: ReorderItem & { id: string }) => void;
   onDelete: (itemId: string) => void;
-  dragControls: any;
+  dragControls: DragControls;
 }
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2963aaa and 1ef803f.

📒 Files selected for processing (8)
  • apps/desktop/src/components/main/body/sessions/floating/listen.tsx (4 hunks)
  • apps/desktop/src/components/settings/integrations.tsx (3 hunks)
  • apps/desktop/src/components/settings/template/editor.tsx (1 hunks)
  • apps/desktop/src/components/settings/template/index.tsx (2 hunks)
  • apps/desktop/src/components/settings/template/sections-list.tsx (1 hunks)
  • apps/desktop/src/devtool/seed/shared.ts (2 hunks)
  • apps/desktop/src/routes/app/settings/_layout.index.tsx (2 hunks)
  • apps/desktop/src/routes/app/settings/_layout.tsx (5 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
apps/desktop/**/*.{tsx,jsx}

📄 CodeRabbit inference engine (apps/desktop/.cursor/rules/style.mdc)

apps/desktop/**/*.{tsx,jsx}: When there are many Tailwind classNames with conditional logic, use the utility cn imported as import { cn } from "@hypr/utils"
When using cn for Tailwind classNames, always pass an array
Group Tailwind classNames by logical sections when using cn (split array items by grouping)

Files:

  • apps/desktop/src/components/main/body/sessions/floating/listen.tsx
  • apps/desktop/src/routes/app/settings/_layout.index.tsx
  • apps/desktop/src/components/settings/template/editor.tsx
  • apps/desktop/src/components/settings/integrations.tsx
  • apps/desktop/src/components/settings/template/index.tsx
  • apps/desktop/src/components/settings/template/sections-list.tsx
  • apps/desktop/src/routes/app/settings/_layout.tsx
🧬 Code graph analysis (5)
apps/desktop/src/routes/app/settings/_layout.index.tsx (3)
plugins/windows/src/ext.rs (1)
  • navigate (19-41)
apps/desktop/src/routes/app/settings/_layout.tsx (1)
  • Route (49-52)
apps/desktop/src/components/settings/template/index.tsx (1)
  • SettingsTemplates (19-117)
apps/desktop/src/components/settings/template/editor.tsx (2)
apps/desktop/src/components/settings/shared.tsx (1)
  • useUpdateTemplate (41-58)
apps/desktop/src/components/settings/template/sections-list.tsx (1)
  • SectionsList (19-93)
apps/desktop/src/components/settings/template/index.tsx (3)
apps/desktop/src/contexts/search/ui.tsx (1)
  • useSearch (219-225)
packages/db/src/schema.ts (1)
  • templates (100-105)
apps/desktop/src/components/settings/template/editor.tsx (1)
  • TemplateEditor (6-47)
apps/desktop/src/devtool/seed/shared.ts (3)
apps/desktop/src/store/tinybase/persisted.ts (1)
  • TemplateStorage (128-128)
packages/db/src/schema.ts (1)
  • templates (100-105)
apps/desktop/src/utils/index.ts (1)
  • id (3-3)
apps/desktop/src/routes/app/settings/_layout.tsx (1)
apps/desktop/src/components/settings/shared.tsx (1)
  • useUpdateTemplate (41-58)
🪛 Biome (2.1.2)
apps/desktop/src/components/settings/template/index.tsx

[error] 38-38: filtered is assigned to itself.

This is where is assigned.

Self assignments have no effect and can be removed.

(lint/correctness/noSelfAssign)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: zizmor
  • GitHub Check: ci (macos, macos-14)
🔇 Additional comments (29)
apps/desktop/src/components/main/body/sessions/floating/listen.tsx (4)

57-61: Improved Icon sizing using the appropriate prop.

Converting from Tailwind className to the Icon component's native size prop is the correct approach and more maintainable.


64-73: Improved Icon sizing using the appropriate prop.

Converting from Tailwind className to the Icon component's native size prop is the correct approach and more maintainable.


75-84: Improved Icon sizing using the appropriate prop.

Converting from Tailwind className to the Icon component's native size prop is the correct approach and more maintainable.


86-95: Improved Icon sizing using the appropriate prop.

Converting from Tailwind className to the Icon component's native size prop is the correct approach and more maintainable.

apps/desktop/src/components/settings/integrations.tsx (4)

2-2: LGTM - ButtonGroup import added correctly.

The import is properly specified and used in the filter controls below.


88-92: LGTM - Filter state management is well-typed.

The FilterStatus type clearly defines the three filter options, and the state is properly initialized to show all integrations by default.


96-116: Excellent implementation of combined filtering.

The two-stage filtering approach is clean and efficient:

  1. Status filter is applied first with correct logic for all three states
  2. Search filter follows with case-insensitive matching on both name and description
  3. Dependencies in useMemo are complete and correct

The implementation is maintainable and performs well.


132-156: LGTM - Filter controls are well-implemented.

The ButtonGroup provides clear visual feedback with the conditional variant logic correctly showing the active filter state. The layout and spacing are appropriate, and the button labels are clear and user-friendly.

apps/desktop/src/devtool/seed/shared.ts (1)

237-312: No issues found with JSON serialization approach.

After examining the codebase, the JSON.stringify() call on line 308 is correct and necessary. This codebase uses TinyBase (not Drizzle ORM), where the schema explicitly stores JSON fields as strings (sections: { type: "string" }).

The jsonObject helper is designed to accept either strings or objects, automatically calling JSON.parse() when the input is a string. The data flows correctly:

  1. Seed creates sections as an array and stringifies it before storage
  2. TinyBase stores the stringified JSON
  3. When retrieved, the jsonObject schema automatically parses it back to an object
  4. The UI accesses sections as an array

The existing pattern in the codebase is consistent—other components like apps/desktop/src/components/settings/shared.tsx:50 use the same JSON.stringify() approach for template sections.

apps/desktop/src/routes/app/settings/_layout.index.tsx (2)

17-17: LGTM!

The navigate hook is correctly obtained from the router and will be used to enable template navigation flows.


26-26: LGTM!

The navigate prop is correctly passed to SettingsTemplates, enabling the component to handle template-specific navigation.

apps/desktop/src/components/settings/template/editor.tsx (3)

6-6: LGTM! Simplified signature aligns with navigation-based flow.

The removal of the onClose prop simplifies the component, with navigation now handled through the routing layer (via the back button in TemplateEditorHeader).


7-7: LGTM!

The useUpdateTemplate hook correctly provides type-safe template state management.


13-46: LGTM! Clean and declarative UI.

The simplified editor structure with Title, Description, and Sections is easy to understand and maintain. The inline styles and placeholders provide good UX.

apps/desktop/src/routes/app/settings/_layout.tsx (4)

2-47: LGTM!

The new imports and search validation schema are correctly structured to support template editing functionality.


78-104: LGTM! Clean conditional rendering.

The header correctly switches between the standard settings header and the template editor header based on the presence of a templateId.


264-287: LGTM! Well-implemented inline title editing.

The title editing UX is intuitive with good keyboard support (Enter to save, blur to exit) and appropriate fallback text.


291-323: LGTM! Clean action controls.

The Edit button and dropdown menu provide clear access to template actions, with appropriate styling for the destructive delete action.

apps/desktop/src/components/settings/template/index.tsx (6)

13-17: LGTM! Clear type definitions.

The FilterStatus and SettingsTemplatesProps types are well-defined and support the component's navigation and filtering requirements.


54-56: LGTM!

The conditional rendering correctly switches to the TemplateEditor when a templateId is present, using the updated component signature.


58-79: LGTM! Clear filter UI.

The header and filter buttons provide an intuitive interface for switching between all and favorite templates.


81-90: LGTM!

The search input is well-implemented with proper icon positioning and clear placeholder text.


92-116: LGTM! Good UX for empty and populated states.

The empty state provides helpful feedback, and the template list correctly navigates to individual templates when clicked.


119-143: LGTM! Well-styled template card.

The TemplateCard layout and styling provide a clean, clickable interface with appropriate hover states and text sizing. The use of cn() follows the coding guidelines.

As per coding guidelines.

apps/desktop/src/components/settings/template/sections-list.tsx (5)

1-17: LGTM! Clean imports and type definitions.

The component dependencies and type definitions are well-organized and appropriate for the drag-and-drop functionality.


24-28: LGTM! Stable keys for reordering.

Using crypto.randomUUID() to generate stable IDs for drag-and-drop is appropriate. Since this is a Tauri desktop app, the Web Crypto API will be available in the embedded Chromium runtime.


30-59: LGTM! Well-structured change handlers.

The handlers correctly manage local state and propagate changes via the onChange callback. The disabled check in handleReorder properly prevents unwanted reordering.


61-92: LGTM! Proper drag-and-drop setup.

The Reorder.Group and Reorder.Item components are correctly configured with stable keys and proper event handling. The Add Section button is appropriately placed and respects the disabled state.


130-172: LGTM! Well-implemented section item controls.

The drag handle and delete button with hover-based visibility provide a clean UX. The Input and Textarea components are properly configured with focus handlers and helpful placeholders.

@yujonglee yujonglee changed the title template template setting styling Oct 23, 2025
@yujonglee yujonglee merged commit 22ea77b into main Oct 23, 2025
3 checks passed
@coderabbitai coderabbitai bot mentioned this pull request Nov 15, 2025
@ComputelessComputer ComputelessComputer deleted the jj-branch-25 branch December 14, 2025 15:18
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