Skip to content

feat: drawer on new epic comment#114

Merged
hmbanan666 merged 1 commit into
mainfrom
drawer
Aug 29, 2025
Merged

feat: drawer on new epic comment#114
hmbanan666 merged 1 commit into
mainfrom
drawer

Conversation

@hmbanan666
Copy link
Copy Markdown
Collaborator

@hmbanan666 hmbanan666 commented Aug 29, 2025

Summary by CodeRabbit

  • New Features

    • Epic comment form now opens in a drawer instead of a modal for a smoother workflow and auto-closes on submit.
  • Style

    • Increased input placeholder contrast for better readability.
    • Page background now follows the Telegram secondary theme color.
    • Updated comment label to “Ваш комментарий” and set textarea height to 5 rows.
    • Minor layout tweaks to root container (min-height/background class) for cleaner visuals.

@hmbanan666 hmbanan666 self-assigned this Aug 29, 2025
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Aug 29, 2025

Walkthrough

Switches epic comment creation from a modal to a Drawer-driven form, adjusts Telegram-themed background and placeholder opacities, tweaks minor classes and labels, and adds a root attribute via Nuxt config to support the Drawer wrapper.

Changes

Cohort / File(s) Summary of changes
Theming & layout tweaks
apps/atrium-telegram/app/app.config.ts, apps/atrium-telegram/app/assets/css/styles.css, apps/atrium-telegram/app/app.vue, apps/atrium-telegram/app/layouts/default.vue
Increased placeholder opacity (/25 → /50) for input, inputMenu, selectMenu, textarea; set html/body background to var(--tg-theme-secondary-bg-color, transparent); removed min-h-svh from root UApp; removed tg-bg-secondary from main.
Epic page flow: Modal → Drawer
apps/atrium-telegram/app/pages/epic/[epicId]/index.vue
Replaced modal-based Create Epic Comment with UDrawer hosting FormCreateEpicComment; removed ModalCreateEpicComment import/usage; close handled via overlay.closeAll; passed epic?.id ?? '' to form.
Form UI label & sizing
apps/atrium-telegram/app/components/form/CreateEpicComment.vue
Renamed label to "Ваш комментарий"; set textarea :rows="5".
Nuxt app root attribute
apps/atrium-telegram/nuxt.config.ts
Added app.rootAttrs with 'data-vaul-drawer-wrapper': '' to the root element.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor U as User
  participant C as CreateCard
  participant D as UDrawer
  participant F as FormCreateEpicComment
  participant O as Overlay

  U->>C: Tap "Add comment"
  C->>D: Open Drawer
  D->>F: Mount form (epicId = epic?.id ?? "")
  U->>F: Fill & submit
  F-->>O: Emit success/close
  O-->>D: closeAll()
  D-->>U: Drawer closed

  note over D,F: Drawer replaces previous modal flow
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • chore: inputs rework #100 — Also updates UI slot configurations in app.config.ts, indicating adjacent styling/config work on input components.

Poem

A drawer slides with gentle grace,
Where comments find their cozy place.
The placeholders glow, a softer hue,
Telegram skies now shining through.
I thump my paws—approved, adore! 🐇
Hop, submit, and close the drawer.
Carrots for clean control flow galore! 🥕

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch drawer

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.
    • 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.
  • 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 the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit 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

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • 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.

@sonarqubecloud
Copy link
Copy Markdown

@hmbanan666 hmbanan666 merged commit 7a80b27 into main Aug 29, 2025
7 of 8 checks passed
@hmbanan666 hmbanan666 deleted the drawer branch August 29, 2025 15:15
Copy link
Copy Markdown

@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: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
apps/atrium-telegram/app/components/form/CreateEpicComment.vue (1)

19-29: Prevent duplicate submissions and ignore whitespace-only input.

Users can tap Send multiple times; button only checks truthy text, so whitespace passes and double posts can occur. Disable during submit and require trimmed content.

Apply:

-    <UButton
+    <UButton
       type="submit"
       variant="solid"
       color="secondary"
       size="xl"
       icon="i-lucide-send"
       block
       class="mt-3"
-      :disabled="!state.text"
+      :loading="submitting"
+      :disabled="submitting || !state.text?.trim()"
       :label="$t('common.send')"
     />

And in <script setup>:

 const state = ref<Partial<CreateEpicComment>>({
   text: undefined,
 })
 
+const submitting = ref(false)
+
 async function onSubmit(event: FormSubmitEvent<CreateEpicComment>) {
   emit('submitted')
 
   try {
-    await $fetch(`/api/epic/id/${epicId}/comment`, {
+    submitting.value = true
+    const body = { ...event.data, text: event.data.text.trim() }
+    await $fetch(`/api/epic/id/${epicId}/comment`, {
       method: 'POST',
       headers: {
         Authorization: `tma ${userStore.initDataRaw}`,
+        'Content-Type': 'application/json',
       },
-      body: event.data,
+      body,
     })
@@
     vibrate('success')
     emit('success')
   } catch (error) {
     console.error(error)
     vibrate('error')
+  } finally {
+    submitting.value = false
   }
 }
🧹 Nitpick comments (1)
apps/atrium-telegram/app/components/form/CreateEpicComment.vue (1)

54-60: Guard missing auth and surface an actionable error.

If initDataRaw is absent/expired, request will 401. Consider a quick guard to notify and abort before the call.

Example:

-    await $fetch(`/api/epic/id/${epicId}/comment`, {
+    if (!userStore.initDataRaw) {
+      vibrate('error')
+      return
+    }
+    await $fetch(`/api/epic/id/${epicId}/comment`, {
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between d961aac and 002d6fa.

📒 Files selected for processing (7)
  • apps/atrium-telegram/app/app.config.ts (1 hunks)
  • apps/atrium-telegram/app/app.vue (0 hunks)
  • apps/atrium-telegram/app/assets/css/styles.css (1 hunks)
  • apps/atrium-telegram/app/components/form/CreateEpicComment.vue (1 hunks)
  • apps/atrium-telegram/app/layouts/default.vue (1 hunks)
  • apps/atrium-telegram/app/pages/epic/[epicId]/index.vue (1 hunks)
  • apps/atrium-telegram/nuxt.config.ts (1 hunks)
💤 Files with no reviewable changes (1)
  • apps/atrium-telegram/app/app.vue
⏰ 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). (1)
  • GitHub Check: build
🔇 Additional comments (7)
apps/atrium-telegram/app/components/form/CreateEpicComment.vue (1)

8-13: Copy & UX tweak looks good.

Label update and fixed initial height via rows improve clarity and stability with autoresize.

apps/atrium-telegram/app/layouts/default.vue (1)

2-2: Background source changed — verify page fill and Drawer overlay.

Dropping tg-bg-secondary relies on html/body bg (styles.css). Ensure short pages still render full-height background behind the Drawer and content (no “striped” areas). If gaps appear, add min-h-dvh on main.

apps/atrium-telegram/app/app.config.ts (1)

5-21: Placeholder opacity change acknowledged.

The /50 opacity improves readability; aligns across inputs/menus/textarea. No action needed.

apps/atrium-telegram/app/assets/css/styles.css (1)

108-110: Good move to theme-driven background.

Using var(--tg-theme-secondary-bg-color, transparent) on html, body centralizes theming and matches the layout change.

apps/atrium-telegram/nuxt.config.ts (1)

31-35: Confirm Nuxt support for app.rootAttrs; fallback to app.vue if not.

Some Nuxt versions don’t render app.rootAttrs. If unsupported, Vaul won’t find data-vaul-drawer-wrapper and body scroll locking can break. Alternative: set the attribute on the root element in app.vue.

Proposed fallback in app.vue (template):

<template>
  <UApp>
    <div data-vaul-drawer-wrapper>
      <NuxtLayout />
    </div>
  </UApp>
</template>

Or attach directly on the root wrapper you control.

apps/atrium-telegram/app/pages/epic/[epicId]/index.vue (2)

62-62: LGTM: keep only ModalUpdateEpic import

Import cleanup aligned with Drawer-based creation flow.


41-57: Verify UDrawer API and Vaul wrapper configuration

  • UDrawer isn’t defined in this repo—please confirm (against your UI library/docs) that it exposes a #trigger slot and properly handles the should-scale-background and set-background-color-on-scale props.
  • The data-vaul-drawer-wrapper entry in apps/atrium-telegram/nuxt.config.ts under app.rootAttrs is present.

Comment on lines +41 to +57
<UDrawer should-scale-background :set-background-color-on-scale="false">
<CreateCard
v-if="epic?.id"
:label="$t('app.create.epic-comment.button')"
icon="i-lucide-message-circle"
/>

<template #content>
<div class="p-4">
<FormCreateEpicComment
:epic-id="epic?.id ?? ''"
@submitted="overlay.closeAll"
@success="overlay.closeAll"
/>
</div>
</template>
</UDrawer>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

⚠️ Potential issue

Close only this drawer and guard epic-id; avoid overlay.closeAll side effects

Using overlay.closeAll may not close this Drawer and can nuke unrelated overlays. Also, passing '' to epic-id risks invalid submissions. Control the Drawer locally and gate the form on epic.id.

-    <UDrawer should-scale-background :set-background-color-on-scale="false">
-      <CreateCard
-        v-if="epic?.id"
-        :label="$t('app.create.epic-comment.button')"
-        icon="i-lucide-message-circle"
-      />
-
-      <template #content>
-        <div class="p-4">
-          <FormCreateEpicComment
-            :epic-id="epic?.id ?? ''"
-            @submitted="overlay.closeAll"
-            @success="overlay.closeAll"
-          />
-        </div>
-      </template>
-    </UDrawer>
+    <UDrawer v-model:open="isCreateOpen" should-scale-background :set-background-color-on-scale="false">
+      <template #trigger>
+        <CreateCard
+          v-if="epic?.id"
+          :label="$t('app.create.epic-comment.button')"
+          icon="i-lucide-message-circle"
+        />
+      </template>
+      <template #content>
+        <div class="p-4">
+          <FormCreateEpicComment
+            v-if="epic?.id"
+            :epic-id="epic.id"
+            @submitted="isCreateOpen = false"
+            @success="isCreateOpen = false"
+          />
+        </div>
+      </template>
+    </UDrawer>

Add in <script setup>:

const isCreateOpen = ref(false)
🤖 Prompt for AI Agents
In apps/atrium-telegram/app/pages/epic/[epicId]/index.vue around lines 41–57,
avoid using overlay.closeAll and passing an empty string for epic-id; add a
local boolean ref (e.g., isCreateOpen) in <script setup> and bind it to the
UDrawer open prop, toggle it from the CreateCard click handler to open/close
this drawer only, replace @submitted and @success handlers to set
isCreateOpen.value = false (instead of overlay.closeAll), and guard the form by
rendering FormCreateEpicComment only when epic?.id is truthy (or pass
:epic-id="epic.id" without falling back to ''), so invalid submissions are
prevented and only this drawer is closed.

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