Skip to content

fixed build log issue#5

Merged
iamkrish09 merged 3 commits into
mainfrom
dev
May 7, 2026
Merged

fixed build log issue#5
iamkrish09 merged 3 commits into
mainfrom
dev

Conversation

@iamkrish09

@iamkrish09 iamkrish09 commented May 7, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • Bug Fixes

    • Blog page now shows a clear "Blog not found" message when a post is unavailable.
  • New Features

    • Routes for authenticated areas are now protected behind sign-in.
  • UI/UX

    • Header redesigned with updated logo and layout.
    • Blog view and publish screens include a Back button and improved author fallback.
  • Branding

    • Site title updated to "Scryb".

@vercel

vercel Bot commented May 7, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
medium-blog Ready Ready Preview, Comment May 7, 2026 7:34am

@coderabbitai

coderabbitai Bot commented May 7, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Wraps main routes with a new ProtectedRoute; updates Appbar to use a Scryb logo; adds Back navigation to FullBlog and Publish; adds a "Blog not found" guard when blog data is absent; and updates the page title to "Scryb".

Frontend UI & Routing Changes

Layer / File(s) Summary
Routing / Protection
frontend/src/components/ProtectedRoute.tsx, frontend/src/App.tsx
Introduce ProtectedRoute reading localStorage token and nest authenticated routes to redirect unauthenticated users to /signin.
Appbar / Branding
frontend/src/components/Appbar.tsx
Replace text link with scryb_logo image linking to /blogs, update imports and header layout/styling.
FullBlog Back Navigation
frontend/src/components/FullBlog.tsx
Add useNavigate and a "← Back" button calling navigate(-1); adjust Avatar JSX spacing/fallback.
Publish page UI & flow
frontend/src/components/Publish.tsx
Reformat Publish markup, add "Back" button, keep publish async flow (token check → POST → navigate to created post), and reformat TextEditor JSX.
Blog empty-state guard
frontend/src/pages/Blog.tsx
After the loading return, render an Appbar + "Blog not found" message when blog is falsy instead of rendering FullBlog.
Index metadata
frontend/index.html
Change document <title> from frontend to Scryb.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • iamkrish09/medium-blog#4: Touches Appbar.tsx and Publish.tsx with related publish link/button and publish logic changes.
  • iamkrish09/medium-blog#3: Earlier frontend auth and component updates that overlap routing and Blog/Publish components.

Poem

🐰 I hopped through routes and fixed the trail,
A logo, back button, and a missing-blog tale.
When posts go quiet, the guard says "Not found" —
Soft paws, no crash, the app stays sound. ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title 'fixed build log issue' is vague and does not accurately describe the actual changes in this PR, which include routing protection, UI updates (logo/branding), error handling, and navigation improvements. Use a more descriptive title that reflects the main changes, such as 'Add route protection and improve blog UI/UX' or 'Implement ProtectedRoute and enhance blog component navigation'.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@frontend/src/pages/Blog.tsx`:
- Around line 24-26: The "Blog not found" branch in the Blog component currently
returns a bare <div>; update the fallback to render the Appbar component (same
one used in the loading path) and wrap the message in the app's standard
container/styled elements so users keep navigation and consistent styling;
locate the conditional that checks "if (!blog)" in the Blog component and
replace the plain div with a JSX block that includes <Appbar /> plus the app's
usual wrapper/className and a user-facing message (e.g., a centered card or
paragraph) and any existing CSS classes used by other states to maintain visual
consistency.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: fd00215c-9efc-4ed3-b983-89c29ab75061

📥 Commits

Reviewing files that changed from the base of the PR and between 9850e4a and ef9f0e9.

📒 Files selected for processing (1)
  • frontend/src/pages/Blog.tsx

Comment thread frontend/src/pages/Blog.tsx Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (2)
frontend/src/components/Publish.tsx (2)

57-61: ⚡ Quick win

Surface publish errors to the user — console.error alone is invisible.

On failure the button silently re-enables with no feedback. At a minimum, a local error state and an inline message would prevent confusion.

♻️ Suggested error state addition
 const [loading, setLoading] = useState(false);
+const [publishError, setPublishError] = useState<string | null>(null);

Then in the catch block:

                 } catch (error) {
                     console.error("Error publishing post", error);
+                    setPublishError("Failed to publish. Please try again.");
                 } finally {

And render the message near the buttons:

+{publishError && (
+    <p className="mt-2 text-sm text-red-500">{publishError}</p>
+)}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@frontend/src/components/Publish.tsx` around lines 57 - 61, Add a local error
state (e.g., publishError via useState) and set it in the catch block inside the
publish handler instead of only calling console.error; update the catch to
setPublishError(error?.message || "Failed to publish") and keep
setLoading(false) in finally; also clear publishError at start of publish (or on
retry) and render the publishError string inline next to the publish/cancel
buttons so users see a clear message when the publish action fails — locate
these changes around the existing try/catch in the publish handler and the
setLoading call.

63-65: ⚡ Quick win

type="submit" has no effect here and is semantically misleading.

The Publish button lives in a plain <div>, not inside a <form>. The <form> wrapping the <textarea> is a separate sibling element rendered by TextEditor. A type="submit" button with no form attribute association has no form-submission semantics; type="button" is the correct choice.

♻️ Proposed fix
-                            type="submit"
+                            type="button"
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@frontend/src/components/Publish.tsx` around lines 63 - 65, The Publish button
in Publish.tsx is currently using type="submit" while sitting outside any form
(the TextEditor form is a sibling), so change the button's type to "button" (or
add a form attribute only if you intend it to target a specific form) to restore
correct semantics and behavior; update the JSX where the element with props
disabled={loading} type="submit" className="..." is defined to use type="button"
and keep the existing disabled and click handlers intact.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@frontend/src/components/Appbar.tsx`:
- Around line 8-13: The logo image currently uses className "h-30" causing it to
overflow its Link container (className "h-24"); update the <img> inside the Link
(component using scryb_logo) to use a height that fits the container (e.g.,
replace "h-30" with "h-full") and keep "w-auto object-contain" so the logo
scales to container height without stretching or overflowing.

In `@frontend/src/components/Publish.tsx`:
- Line 56: The navigate call uses response.data.id unguarded; update the submit
handler in Publish.tsx to check that response and response.data.id are present
before calling navigate(`/blog/${response.data.id}`) — e.g., if
(response?.data?.id) navigate(...); otherwise handle the missing id by showing
an error/confirmation (toast/modal) and not navigating (or navigate to a safe
fallback like the blog list), and ensure any form state cleanup (e.g.,
setSubmitting(false)) still runs; reference the navigate function and
response.response.data.id in your changes.

---

Nitpick comments:
In `@frontend/src/components/Publish.tsx`:
- Around line 57-61: Add a local error state (e.g., publishError via useState)
and set it in the catch block inside the publish handler instead of only calling
console.error; update the catch to setPublishError(error?.message || "Failed to
publish") and keep setLoading(false) in finally; also clear publishError at
start of publish (or on retry) and render the publishError string inline next to
the publish/cancel buttons so users see a clear message when the publish action
fails — locate these changes around the existing try/catch in the publish
handler and the setLoading call.
- Around line 63-65: The Publish button in Publish.tsx is currently using
type="submit" while sitting outside any form (the TextEditor form is a sibling),
so change the button's type to "button" (or add a form attribute only if you
intend it to target a specific form) to restore correct semantics and behavior;
update the JSX where the element with props disabled={loading} type="submit"
className="..." is defined to use type="button" and keep the existing disabled
and click handlers intact.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 2a96da72-54d6-44bc-97bd-6cbc57451606

📥 Commits

Reviewing files that changed from the base of the PR and between ef9f0e9 and f533bca.

⛔ Files ignored due to path filters (1)
  • frontend/src/assets/scryb_logo.png is excluded by !**/*.png
📒 Files selected for processing (7)
  • frontend/index.html
  • frontend/src/App.tsx
  • frontend/src/components/Appbar.tsx
  • frontend/src/components/FullBlog.tsx
  • frontend/src/components/ProtectedRoute.tsx
  • frontend/src/components/Publish.tsx
  • frontend/src/pages/Blog.tsx
✅ Files skipped from review due to trivial changes (2)
  • frontend/index.html
  • frontend/src/components/ProtectedRoute.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • frontend/src/pages/Blog.tsx

Comment thread frontend/src/components/Appbar.tsx
Comment thread frontend/src/components/Publish.tsx
@iamkrish09 iamkrish09 merged commit e760add into main May 7, 2026
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