8000 update UI, features, adding workspaces by R44VC0RP · Pull Request #4 · R44VC0RP/agenda.dev · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

update UI, features, adding workspaces #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Apr 24, 2025
Merged

update UI, features, adding workspaces #4

merged 10 commits into from
Apr 24, 2025

Conversation

R44VC0RP
Copy link
Owner
@R44VC0RP R44VC0RP commented Apr 24, 2025

Database and Schema Updates:

  • Added workspaces and workspace_members tables, and updated the todos table to include a workspace_id column. This enables todos to be associated with specific workspaces. (WORKSPACE-IMPLEMENTATION.md, WORKSPACE-IMPLEMENTATION.mdR1-R355)
  • Updated schema definitions in lib/db/schema.ts to reflect the new database structure. (WORKSPACE-IMPLEMENTATION.md, WORKSPACE-IMPLEMENTATION.mdR1-R355)

API Enhancements:

  • Added workspace-related API routes (app/api/workspaces/route.ts) for creating and retrieving workspaces. (WORKSPACE-IMPLEMENTATION.md, WORKSPACE-IMPLEMENTATION.mdR1-R355)
  • Enhanced todos API (app/api/todos/route.ts) to support workspace filtering, validation using zod, and default personal workspace creation when none is specified. ([[1]](https://github.com/R44VC0RP/agenda.dev/pull/4/files#diff-12b29dcd0801327af6fde149f8d27fdec055e02d2c6e84fb5baaf3db2befc89bL4-R99), [[2]](https://github.com/R44VC0RP/agenda.dev/pull/4/files#diff-12b29dcd0801327af6fde149f8d27fdec055e02d2c6e84fb5baaf3db2befc89bR109-R158), [[3]](https://github.com/R44VC0RP/agenda.dev/pull/4/files#diff-12b29dcd0801327af6fde149f8d27fdec055e02d2c6e84fb5baaf3db2befc89bR195-R224))
  • Introduced input validation for comments API (app/api/todos/comments/route.ts) using zod schemas for better error handling and data integrity. ([[1]](https://github.com/R44VC0RP/agenda.dev/pull/4/files#diff-83dd3c253831cd757527e4686d8a08e3cc747b1d707ea33ff08c7889676dc005R7-R39), [[2]](https://github.com/R44VC0RP/agenda.dev/pull/4/files#diff-83dd3c253831cd757527e4686d8a08e3cc747b1d707ea33ff08c7889676dc005R63-R88), [[3]](https://github.com/R44VC0RP/agenda.dev/pull/4/files#diff-83dd3c253831cd757527e4686d8a08e3cc747b1d707ea33ff08c7889676dc005R99-R102))

UI Components:

  • Created a WorkspaceSwitcher component (components/workspace-switcher.tsx) to allow users to switch between workspaces or create a new one. (WORKSPACE-IMPLEMENTATION.md, WORKSPACE-IMPLEMENTATION.mdR1-R355)
  • Added a NewWorkspaceDialog component (components/new-workspace-dialog.tsx) for creating new workspaces with a user-friendly modal interface. (WORKSPACE-IMPLEMENTATION.md, WORKSPACE-IMPLEMENTATION.mdR1-R355)
  • Updated the main page component (app/page.tsx) to include workspace management features, such as switching and creating workspaces. (WORKSPACE-IMPLEMENTATION.md, WORKSPACE-IMPLEMENTATION.mdR1-R355)

Additional Improvements:

  • Added authentication checks to the convert-date API route to restrict access to authenticated users. (app/api/convert-date/route.ts, [1] [2]
  • Improved error handling across APIs to provide more descriptive error messages and log unexpected issues. ([[1]](https://github.com/R44VC0RP/agenda.dev/pull/4/files#diff-83dd3c253831cd757527e4686d8a08e3cc747b1d707ea33ff08c7889676dc005R63-R88), [[2]](https://github.com/R44VC0RP/agenda.dev/pull/4/files#diff-83dd3c253831cd757527e4686d8a08e3cc747b1d707ea33ff08c7889676dc005R99-R102), [[3]](https://github.com/R44VC0RP/agenda.dev/pull/4/files#diff-12b29dcd0801327af6fde149f8d27fdec055e02d2c6e84fb5baaf3db2befc89bR233-R267))

These changes collectively enhance the application's functionality, usability, and robustness while maintaining its minimal and aesthetic design.

Summary by CodeRabbit

  • New Features

    • Introduced multi-workspace support, enabling users to create, switch, and manage multiple workspaces for their todos.
    • Added workspace switching and management UI, including a dropdown switcher and a dialog for creating new workspaces.
    • Implemented a table view for todos alongside existing list view, with a toggle to switch between them.
    • Added a command palette for keyboard-driven workspace and todo management.
    • Enabled rescheduling of todos with a new dialog and visual indicators for overdue tasks.
    • Integrated toast notifications for user feedback.
    • Enhanced comment management, including improved UI for adding and deleting comments.
  • Bug Fixes

    • Improved error handling and input validation for todos and comments.
    • Ensured todos are always associated with a workspace, improving data integrity.
  • Style

    • Refined UI components for better accessibility, dark/light mode support, and consistent styling.
    • Updated dialog and button styles for a more cohesive appearance.
  • Chores

    • Upgraded and added dependencies to support new features and improve performance.
    • Updated database schema and migrations to support workspaces and related relationships.
  • Documentation

    • Added detailed implementation plan and documentation for workspace support and UI integration.

Copy link
vercel bot commented Apr 24, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
simple-todo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 24, 2025 7:05pm

Copy link
coderabbitai bot commented Apr 24, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

This update introduces comprehensive workspace support to the todo application, spanning database schema, backend API, and frontend UI. New database tables for workspaces and workspace members are added, and todos are now associated with workspaces. The backend implements robust API routes for workspace CRUD operations, with authentication and validation. The frontend is refactored to use a server-side page component that loads initial data, and a new client component manages todos and workspaces with persistent state and optimistic updates. New UI components include workspace switcher, new workspace dialog, reschedule dialog, view toggle, and a command palette. Styling and accessibility are enhanced throughout, and toast notifications are integrated.

Changes

File(s) / Path(s) Change Summary
lib/db/migrations/0005_add_workspaces.sql, lib/db/migrations/0005_rainy_wild_pack.sql, lib/db/migrations/meta/0004_snapshot.json, lib/db/migrations/meta/0005_snapshot.json, lib/db/migrations/meta/_journal.json Added/updated migration scripts and snapshots to introduce workspaces, workspace members, and enforce NOT NULL constraints on relevant columns.
lib/db/schema.ts Added workspaces and workspaceMembers tables, updated todos to include workspaceId with foreign key constraints.
lib/types.ts Added Workspace and WorkspaceMember interfaces; extended Todo with optional workspaceId.
app/api/workspaces/route.ts, app/api/workspaces/personal/route.ts Added new API endpoints for workspace CRUD operations and personal workspace creation, with authentication and validation.
app/api/todos/route.ts, app/api/todos/comments/route.ts Enhanced todos and comments API routes with input validation (zod), workspace support, error handling, and consistent response formatting.
app/api/convert-date/route.ts Added authentication to date conversion endpoint and expanded system prompt with detailed date/time context.
app/page.tsx Refactored from client-side to server-side data loading; now fetches session and todos with workspaces and comments, and passes initial data to a client component.
app/HomeClient.tsx New client component managing todos, workspaces, and UI state, with localStorage sync, optimistic updates, and integration of new UI components.
components/workspace-switcher.tsx, components/new-workspace-dialog.tsx New components for workspace switching and creation dialogs, with animated transitions and accessibility.
components/todo-input.tsx Enhanced for authenticated/guest date input modes, integrating AI date parsing for logged-in users and a date picker for guests.
components/todo-item.tsx, components/todo-list.tsx, components/todo-table.tsx Added rescheduling functionality, overdue highlighting, comment UI refinements, and new interactive table view for todos.
components/delete-confirmation.tsx, components/reschedule-dialog.tsx Refactored and added modal dialogs for delete confirmation and rescheduling, using standardized dialog components and animations.
components/command-palette.tsx New command palette component enabling keyboard-driven management of todos and workspaces with multi-step flows and async date parsing.
components/view-toggle.tsx New toggle component for switching between table and card views.
components/toast-provider.tsx, app/layout.tsx Added toast notification provider and integrated it into the app layout.
components/LoginButton.tsx Restyled login/logout buttons and added localStorage cleanup on sign-out.
components/ui/dialog.tsx Simplified dialog overlay and content styling, softened background, and narrowed dialog width.
components/theme-provider.tsx Disabled theme transition animations on change.
app/globals.css Added highlight animation and utility class for background transitions.
package.json Updated dependency versions, added next-auth and react-hotkeys-hook, upgraded sonner and zod.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant HomeClient
    participant API
    participant DB

    User->>HomeClient: Open app / interact with UI
    HomeClient->>API: Fetch todos & workspaces (GET)
    API->>DB: Query todos, workspaces, comments
    DB-->>API: Return data
    API-->>HomeClient: Return todos & workspaces

    User->>HomeClient: Create workspace
    HomeClient->>API: POST /workspaces
    API->>DB: Insert workspace, add member (transaction)
    DB-->>API: Workspace created
    API-->>HomeClient: Return new workspace

    User->>HomeClient: Add todo (with workspace)
    HomeClient->>API: POST /todos
    API->>DB: Insert todo with workspaceId
    DB-->>API: Todo created
    API-->>HomeClient: Return new todo

    User->>HomeClient: Switch workspace
    HomeClient->>API: GET /todos?workspaceId=...
    API->>DB: Query todos for workspace
    DB-->>API: Return workspace todos
    API-->>HomeClient: Return filtered todos
Loading

Poem

In a meadow of workspaces, bunnies now leap,
Tasks sorted in burrows, their boundaries deep.
With a flick of a whisker, switch spaces with glee,
And reschedule your carrots—so easy to see!
Dialogs pop up like mushrooms in spring,
While toasts and new tables make everypaw sing.
Hippity-hop, what a wonderful feat—
This workspace update is truly elite! 🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c5ecd94 and ef99ab7.

⛔ Files ignored due to path filters (2)
  • bun.lockb is excluded by !**/bun.lockb
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (32)
  • WORKSPACE-IMPLEMENTATION.md (1 hunks)
  • app/HomeClient.tsx (1 hunks)
  • app/api/convert-date/route.ts (2 hunks)
  • app/api/todos/comments/route.ts (1 hunks)
  • app/api/todos/route.ts (3 hunks)
  • app/api/workspaces/personal/route.ts (1 hunks)
  • app/api/workspaces/route.ts (1 hunks)
  • app/globals.css (1 hunks)
  • app/layout.tsx (2 hunks)
  • app/page.tsx (1 hunks)
  • components/LoginButton.tsx (1 hunks)
  • components/command-palette.tsx (1 hunks)
  • components/delete-confirmation.tsx (1 hunks)
  • components/new-workspace-dialog.tsx (1 hunks)
  • components/reschedule-dialog.tsx (1 hunks)
  • components/theme-provider.tsx (1 hunks)
  • components/toast-provider.tsx (1 hunks)
  • components/todo-input.tsx (10 hunks)
  • components/todo-item.tsx (11 hunks)
  • components/todo-list.tsx (4 hunks)
  • components/todo-table.tsx (1 hunks)
  • components/ui/dialog.tsx (2 hunks)
  • components/view-toggle.tsx (1 hunks)
  • components/workspace-switcher.tsx (1 hunks)
  • lib/db/migrations/0005_add_workspaces.sql (1 hunks)
  • lib/db/migrations/0005_rainy_wild_pack.sql (1 hunks)
  • lib/db/migrations/meta/0004_snapshot.json (1 hunks)
  • lib/db/migrations/meta/0005_snapshot.json (1 hunks)
  • lib/db/migrations/meta/_journal.json (1 hunks)
  • lib/db/schema.ts (2 hunks)
  • lib/types.ts (2 hunks)
  • package.json (4 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@R44VC0RP R44VC0RP merged commit 64e65ef into main Apr 24, 2025
2 of 3 checks passed
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.

1 participant
0