Skip to content

Conversation

@yujonglee
Copy link
Contributor

No description provided.

Add a header with tauri drag region to prevent the traffic light controls from covering content and enable window dragging. Move padding and content into a scrollable main area (div with overflow-y-auto and p-4) and reorganize component order so TinyTickMonitor, SeedList and NavigationList live inside the scrollable region. Also remove the extra padding on the root container to ensure header aligns correctly.
Center title in devtool header and simplify label

The devtool header title was not properly centered and the label also read "Hyprnote Devtool". Wrap the title in a flex container to center it horizontally and remove the extra justification class. Also simplify the visible label to "Devtool" and keep the tauri drag region on the span. This improves header alignment and shortens the title for clarity.
wip
v
Add devtool route, UI trigger, and window type

Introduce a developer tools (devtool) route and UI entry to help with debugging and seeding app state during development. This adds a new /app/devtool route and component (seed list, navigation helpers, TinyTick monitor), exposes a window type "devtool" in the windows plugin, and wires a small AxeIcon button in the desktop sidebar (DEV-only) to open the devtool window.

Changes:
- Add apps/desktop/src/routes/app/devtool.tsx implementing the devtool UI, window-driven navigation helpers, and a global window.__dev API for running seeds.
- Add a DEV-only AxeIcon button to apps/desktop/src/components/main/sidebar/index.tsx that triggers windowsCommands.windowShow({ type: 'devtool' }).
- Export windows commands/events usage in desktop routes and remove unused Suspense/devtool wrapper logic.
- Extend plugins/windows/src/window/v1.rs to include a Devtool AppWindow variant and implement window creation behavior (size tweaks, always_on_top for devtool).

This is needed to provide an in-app developer tool for quick state seeding and navigation during development without changing production behavior.
v
v
@netlify
Copy link

netlify bot commented Nov 19, 2025

Deploy Preview for hyprnote ready!

Name Link
🔨 Latest commit dd284c6
🔍 Latest deploy log https://app.netlify.com/projects/hyprnote/deploys/691d2d77100f6900075be477
😎 Deploy Preview https://deploy-preview-1727--hyprnote.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai
Copy link

coderabbitai bot commented Nov 19, 2025

📝 Walkthrough

Walkthrough

The PR restructures the devtool system from a globally-managed overlay component into a route-based window, updates relative import paths across seed modules (3-level to 4-level), integrates devtool window support into the plugin system, adds a sidebar button to launch the devtool, and removes the old devtool UI module.

Changes

Cohort / File(s) Change Summary
Seed module import path corrections
apps/desktop/src/components/devtool/seed/data/loader.ts, apps/desktop/src/components/devtool/seed/shared/builders.ts, apps/desktop/src/components/devtool/seed/shared/calendar.ts, apps/desktop/src/components/devtool/seed/shared/enhanced-note.ts, apps/desktop/src/components/devtool/seed/shared/event.ts, apps/desktop/src/components/devtool/seed/shared/folder.ts, apps/desktop/src/components/devtool/seed/shared/human.ts, apps/desktop/src/components/devtool/seed/shared/index.ts, apps/desktop/src/components/devtool/seed/shared/mapping.ts, apps/desktop/src/components/devtool/seed/shared/memory.ts, apps/desktop/src/components/devtool/seed/shared/organization.ts, apps/desktop/src/components/devtool/seed/shared/session.ts, apps/desktop/src/components/devtool/seed/shared/tag.ts, apps/desktop/src/components/devtool/seed/shared/template.ts, apps/desktop/src/components/devtool/seed/shared/transcript.ts, apps/desktop/src/components/devtool/seed/versions/*
Updated all relative import paths from ../../../store/tinybase/main and ../../../utils to ../../../../store/tinybase/main and ../../../../utils respectively
Chat seed explicit return type
apps/desktop/src/components/devtool/seed/shared/chat.ts
Added explicit return type { id: string; data: ChatGroup } to createChatGroup() function, replacing inline satisfies ChatGroup assertion; import paths also updated
Devtool component migration
apps/desktop/src/devtool/index.tsx
Removed entire Devtool UI module including DevtoolTrigger, DevtoolDrawer, DevtoolSection, NavigationList, SeedList, and related draggable trigger/drawer state management and seed execution logic
Devtool route implementation
apps/desktop/src/routes/app/devtool.tsx
Added new devtool route at "/app/devtool" with component-based UI, window.__dev API for seed execution, TinyTickMonitor, SeedList, NavigationList integration, and seed management within persisted Tinybase store
Root route cleanup
apps/desktop/src/routes/__root.tsx
Removed Devtool component integration, lazy loading, conditional rendering logic, and useQuery-based app identifier check; cleaned up related imports
Sidebar devtool button
apps/desktop/src/components/main/sidebar/index.tsx
Added AxeIcon import from lucide-react and windowsCommands from @hypr/plugin-windows; injected DEV-only button in header that opens devtool window via windowsCommands.windowShow({ type: "devtool" })
Route import path correction
apps/desktop/src/routes/app/route.tsx
Updated relative import paths from ../ to ../../ for module resolution
Windows plugin devtool support
plugins/windows/src/window/v1.rs
Added Devtool variant to AppWindow enum with serde rename "devtool"; extended Display, FromStr, and WindowImpl implementations to handle Devtool window creation at /app/devtool with resizable and sizing configuration

Sequence Diagram

sequenceDiagram
    participant User
    participant Sidebar as Sidebar Button
    participant WindowsCmd as Windows Commands
    participant Route as /app/devtool Route
    participant Devtool as Devtool Component
    participant Store as Persisted Store

    User->>Sidebar: Click DEV button (DEV mode only)
    Sidebar->>WindowsCmd: windowShow({ type: "devtool" })
    WindowsCmd->>Route: Navigate to /app/devtool
    Route->>Devtool: Render devtool UI
    Devtool->>Store: Access persisted store
    Devtool->>Devtool: Wire window.__dev API
    User->>Devtool: Select and run seed
    Devtool->>Store: seed.run(persistedStore)
    Devtool-->>User: Display result
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Import path updates: Systematic changes across 16 seed module files (repetitive, low-complexity per file, but high file count)
  • Devtool restructuring: Significant logic shift from global overlay to route-based window; requires understanding old vs. new architecture
  • Root route cleanup: Removal of conditional rendering and useQuery logic needs verification of no orphaned dependencies
  • Windows plugin extension: Addition of new enum variant and window builder logic is straightforward but should verify window sizing/positioning

Areas requiring extra attention:

  • Verify the new /app/devtool route is properly integrated with TanStack Router and doesn't conflict with existing routes
  • Confirm the window.__dev API in the devtool route functions identically to the old implementation for seed execution
  • Test that the sidebar devtool button correctly respects DEV mode and the windows plugin correctly creates the devtool window with proper dimensions
  • Ensure all removed dependencies from __root.tsx (useQuery, Suspense, lazy Devtool import) are no longer needed elsewhere

Possibly related PRs

  • global-ui-changes #1670: Modifies the original devtool UI implementation (DevtoolDrawer, trigger logic) that this PR removes and replaces with route-based approach
  • Overlay floating control #908: Extends AppWindow enum and window plugin implementation to support new window variants, similar structural changes to the windows plugin as this PR
  • Transcript viewer final #1603: Updates transcript seed generation logic in the same file (apps/desktop/src/components/devtool/seed/shared/transcript.ts) affected by import path changes here

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 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.
Description check ❓ Inconclusive No description was provided by the author, which is very vague and conveys no meaningful information about the changeset. Provide a description explaining the motivation and scope of changes, such as why a separate devtool window is needed and what functionality it provides.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main objective of the PR: adding a separate window for the devtool UI.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch devtool-add-window-route-seed-ui

📜 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 fb12dff and dd284c6.

⛔ Files ignored due to path filters (2)
  • apps/desktop/src/routeTree.gen.ts is excluded by !**/*.gen.ts
  • plugins/windows/js/bindings.gen.ts is excluded by !**/*.gen.ts
📒 Files selected for processing (25)
  • apps/desktop/src/components/devtool/seed/data/loader.ts (1 hunks)
  • apps/desktop/src/components/devtool/seed/shared/builders.ts (1 hunks)
  • apps/desktop/src/components/devtool/seed/shared/calendar.ts (1 hunks)
  • apps/desktop/src/components/devtool/seed/shared/chat.ts (1 hunks)
  • apps/desktop/src/components/devtool/seed/shared/enhanced-note.ts (1 hunks)
  • apps/desktop/src/components/devtool/seed/shared/event.ts (1 hunks)
  • apps/desktop/src/components/devtool/seed/shared/folder.ts (1 hunks)
  • apps/desktop/src/components/devtool/seed/shared/human.ts (1 hunks)
  • apps/desktop/src/components/devtool/seed/shared/index.ts (1 hunks)
  • apps/desktop/src/components/devtool/seed/shared/mapping.ts (1 hunks)
  • apps/desktop/src/components/devtool/seed/shared/memory.ts (1 hunks)
  • apps/desktop/src/components/devtool/seed/shared/organization.ts (1 hunks)
  • apps/desktop/src/components/devtool/seed/shared/session.ts (1 hunks)
  • apps/desktop/src/components/devtool/seed/shared/tag.ts (1 hunks)
  • apps/desktop/src/components/devtool/seed/shared/template.ts (1 hunks)
  • apps/desktop/src/components/devtool/seed/shared/transcript.ts (1 hunks)
  • apps/desktop/src/components/devtool/seed/versions/curated.ts (1 hunks)
  • apps/desktop/src/components/devtool/seed/versions/empty.ts (1 hunks)
  • apps/desktop/src/components/devtool/seed/versions/random.ts (1 hunks)
  • apps/desktop/src/components/main/sidebar/index.tsx (2 hunks)
  • apps/desktop/src/devtool/index.tsx (0 hunks)
  • apps/desktop/src/routes/__root.tsx (1 hunks)
  • apps/desktop/src/routes/app/devtool.tsx (1 hunks)
  • apps/desktop/src/routes/app/route.tsx (1 hunks)
  • plugins/windows/src/window/v1.rs (5 hunks)
💤 Files with no reviewable changes (1)
  • apps/desktop/src/devtool/index.tsx
🧰 Additional context used
🧬 Code graph analysis (3)
plugins/windows/src/window/v1.rs (1)
plugins/windows/src/events.rs (3)
  • window (14-14)
  • window (34-34)
  • app (32-32)
apps/desktop/src/components/devtool/seed/shared/chat.ts (2)
apps/desktop/src/store/tinybase/schema-external.ts (1)
  • ChatGroup (165-165)
apps/desktop/src/utils/index.ts (1)
  • DEFAULT_USER_ID (7-7)
apps/desktop/src/routes/app/devtool.tsx (4)
apps/desktop/src/components/devtool/seed/index.ts (2)
  • seeds (6-6)
  • SeedDefinition (4-4)
apps/desktop/src/components/devtool/seed/shared/index.ts (1)
  • SeedDefinition (22-26)
packages/utils/src/cn.ts (1)
  • cn (20-22)
apps/desktop/src/components/devtool/tinytick.tsx (1)
  • TinyTickMonitor (14-148)
⏰ 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). (5)
  • GitHub Check: Redirect rules - hyprnote
  • GitHub Check: Header rules - hyprnote
  • GitHub Check: Pages changed - hyprnote
  • GitHub Check: ci (macos, macos-14)
  • GitHub Check: fmt
🔇 Additional comments (28)
apps/desktop/src/components/main/sidebar/index.tsx (1)

1-1: LGTM! Clean DEV-only devtool integration.

The implementation correctly guards the devtool button behind import.meta.env.DEV and properly integrates with the new window-based devtool system. The use of AxeIcon is fitting for developer tooling.

Also applies to: 4-4, 33-41

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

20-21: LGTM! Import path correctly updated.

The import path adjustments from 3-level to 4-level relative paths are consistent with the broader restructuring across seed modules.

apps/desktop/src/components/devtool/seed/data/loader.ts (1)

5-6: LGTM! Import paths correctly updated.

Consistent with the module resolution changes across other seed files.

plugins/windows/src/window/v1.rs (2)

16-17: LGTM! Devtool variant properly integrated.

The new Devtool enum variant is correctly added with proper serde serialization, Display, FromStr, and title implementations.

Also applies to: 28-28, 43-43, 90-90


159-171: Devtool window configuration looks appropriate.

The window setup mirrors the Chat window pattern with resizable behavior and a 400x600 default size. The temporary 1x1 sizing with sleep appears to be a consistent workaround used across other window types (Settings, Auth, Chat) for proper initialization.

apps/desktop/src/routes/app/devtool.tsx (3)

37-60: Robust window API initialization with proper cleanup.

The useEffect correctly guards against missing window or store, and the cleanup function defensively checks that window.__dev hasn't been reassigned before deleting, preventing potential issues if multiple instances somehow exist.


62-74: Safe seed execution with appropriate guards.

The handleSeed callback and early return pattern ensure seeds are only executed when the persisted store is available, preventing potential runtime errors.


125-158: Navigation commands properly structured.

The navigation handlers correctly use the window commands API. The onboarding handler appropriately chains the window show operation before emitting the navigation event.

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

3-4: LGTM! Import paths correctly updated.

Consistent with the module resolution changes across the seed directory.

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

3-4: LGTM! Import paths correctly updated.

Consistent with the broader path resolution refactor.

apps/desktop/src/components/devtool/seed/versions/empty.ts (1)

1-1: LGTM! Import path correctly updated.

Final path resolution update consistent with the rest of the PR.

apps/desktop/src/components/devtool/seed/versions/random.ts (1)

4-5: Import path updates look correct.

The import paths have been updated from 3-level to 4-level relative paths, consistent with the devtool directory restructure.

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

1-1: Import path update is consistent.

The import path correctly adjusts to the new directory structure.

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

6-7: Import paths correctly updated.

Both store and utils imports have been consistently updated to 4-level relative paths.

apps/desktop/src/routes/app/route.tsx (1)

5-6: Import path adjustments are correct.

The imports have been updated from 1-level to 2-level relative paths, aligning with the route restructuring.

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

3-4: Import paths correctly updated.

The import paths align with the directory restructure.

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

5-6: Import paths correctly adjusted.

The changes are consistent with the overall refactoring.

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

3-4: Import path updates are correct.

The imports follow the consistent pattern across all seed files.

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

3-4: Import paths verified and correct.

The verification script confirms that all imports resolve successfully:

  • apps/desktop/src/store/tinybase/main.ts exists and is accessible
  • apps/desktop/src/utils/index.ts exists and is accessible
  • Seed files parse without syntax errors
  • Relative paths from the component are correctly structured
apps/desktop/src/components/devtool/seed/shared/organization.ts (1)

3-4: LGTM!

The import path updates correctly reflect the directory structure. No functional changes detected.

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

3-4: LGTM!

Import paths correctly updated. The transcript generation logic remains unchanged.

apps/desktop/src/components/devtool/seed/shared/enhanced-note.ts (1)

5-6: LGTM!

Import paths correctly updated to reflect the new directory structure.

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

3-4: LGTM!

Import paths correctly adjusted. No functional changes.

apps/desktop/src/components/devtool/seed/versions/curated.ts (1)

1-1: LGTM!

Import path correctly updated for the PersistedStore type.

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

6-7: LGTM!

Import paths correctly updated. Mapping creation functions remain unchanged.

apps/desktop/src/routes/__root.tsx (1)

7-7: LGTM!

The removal of the Devtool component from the root route aligns with the PR objective to restructure it as a route-based window. The simplified component tree maintains all core functionality.

Also applies to: 22-32

apps/desktop/src/components/devtool/seed/shared/chat.ts (2)

6-7: LGTM!

Import paths correctly updated to match the new directory structure.


9-15: Good improvement with explicit return type annotation.

The explicit return type annotation makes the function signature clearer and more self-documenting. The removal of satisfies ChatGroup while maintaining type safety through the return type is appropriate.


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.

@yujonglee yujonglee merged commit c0bce3b into main Nov 19, 2025
9 checks passed
@yujonglee yujonglee deleted the devtool-add-window-route-seed-ui branch November 19, 2025 03:46
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