Skip to content

Commit 65017c8

Browse files
authored
Merge pull request #92 from techdiary-dev/kingrayhan/fix
v1.5.0
2 parents 6558192 + 59f4734 commit 65017c8

21 files changed

Lines changed: 663 additions & 60 deletions

File tree

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
---
2+
name: github-issue-create
3+
description: >-
4+
Creates a new GitHub issue using the GitHub CLI (gh issue create): title,
5+
body, labels, assignees, milestone, template, or target repo. Use when the
6+
user asks to open, file, or create a GitHub issue via gh; wants gh issue new;
7+
or says to track work on GitHub without an existing issue number.
8+
---
9+
10+
# GitHub issue create (gh CLI)
11+
12+
## When this applies
13+
14+
Use when the user wants a **new** issue recorded on GitHub and agrees to use **`gh`** (not only local notes). If they only want a draft, produce markdown they can paste instead of running `gh`.
15+
16+
## Prerequisites
17+
18+
- `gh` installed and authenticated: `gh auth status` (else `gh auth login`).
19+
- Network access when running `gh`.
20+
- Prefer the **git repo root** so the default remote matches the intended repository.
21+
- Another repo: pass `-R owner/repo` (or `HOST/owner/repo` for GitHub Enterprise).
22+
23+
## 1. Gather content
24+
25+
Before running `gh`, confirm:
26+
27+
- **Title** — short, imperative or problem-focused (e.g. “Profile articles tab shows blank when empty”).
28+
- **Body** — context, steps to reproduce, expected vs actual, screenshots/links as markdown. Do **not** paste secrets, tokens, or full `.env` contents.
29+
30+
Optional metadata from the user:
31+
32+
- **Labels** (`-l`): repeat per label or comma-separated per `gh` examples.
33+
- **Assignee** (`-a`): logins or `@me`.
34+
- **Milestone** (`-m`): exact name as on GitHub.
35+
- **Project** (`-p`): project title; requires `gh auth refresh -s project` if GitHub returns project permission errors.
36+
- **Template** (`-T`): must match a template filename in `.github/ISSUE_TEMPLATE/` (if the repo uses them).
37+
38+
## 2. Create the issue
39+
40+
**Simple (inline):**
41+
42+
```bash
43+
gh issue create --title "Your title" --body "Your body (markdown OK in quotes; use a file for long text)."
44+
```
45+
46+
**Long body or complex markdown — use a file:**
47+
48+
```bash
49+
gh issue create --title "Your title" --body-file path/to/issue-body.md
50+
```
51+
52+
**Stdin:**
53+
54+
```bash
55+
gh issue create --title "Your title" --body-file -
56+
# then paste body, end with Ctrl-D
57+
```
58+
59+
**Labels and self-assign:**
60+
61+
```bash
62+
gh issue create -t "Title" -b "Body" -l bug -l "help wanted" -a "@me"
63+
```
64+
65+
**Editor (title + body in one buffer — first line is title):**
66+
67+
```bash
68+
gh issue create -e
69+
```
70+
71+
**Web UI:**
72+
73+
```bash
74+
gh issue create -w
75+
```
76+
77+
**Explicit repo:**
78+
79+
```bash
80+
gh issue create -R owner/repo -t "Title" -b "Body"
81+
```
82+
83+
**From template:**
84+
85+
```bash
86+
gh issue create --template "Bug Report"
87+
```
88+
89+
Alias: `gh issue new` is equivalent to `gh issue create`.
90+
91+
## 3. After create
92+
93+
`gh` prints the new issue URL. Share it with the user. Optionally mention the related skill for fixing issues: `github-issue-resolve`.
94+
95+
## Safety
96+
97+
- Do **not** run `gh issue create` without a clear title and body the user (or task) actually wants on the public tracker.
98+
- If intent is ambiguous, ask once for title, body, and labels before creating.
99+
100+
## Checklist
101+
102+
- [ ] Title and body ready; no secrets in the body.
103+
- [ ] Correct repo (`cwd` or `-R`).
104+
- [ ] Labels / assignee / milestone / project / template applied if requested.
105+
- [ ] Command run; URL returned to the user.
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
---
2+
name: github-issue-resolve
3+
description: >-
4+
Resolves a numbered GitHub issue using the GitHub CLI (gh): fetch full
5+
context, implement the fix, then post a structured summary comment on the
6+
issue. Use when the user asks to fix, solve, or implement a GitHub issue by
7+
number; mentions gh issue view or GitHub CLI for issues; or says to comment
8+
back on the issue after fixing.
9+
---
10+
11+
# GitHub issue resolve (gh CLI)
12+
13+
## When this applies
14+
15+
Use this workflow when the user gives an issue number (e.g. “fix #57”, “solve issue 42”) and expects the work tracked on GitHub with a **comment**, not only local code changes.
16+
17+
## Prerequisites
18+
19+
- `gh` installed and authenticated: `gh auth status` (if it fails, run `gh auth login`).
20+
- Shell with `network` permission when calling `gh`.
21+
- Run `gh` from the **git repo root** so `gh issue view` targets the correct repository.
22+
23+
## 1. Load the issue
24+
25+
Always fetch the issue before coding so title, body, labels, and images/links are grounded in real data.
26+
27+
```bash
28+
gh issue view <N>
29+
```
30+
31+
Useful additions:
32+
33+
```bash
34+
gh issue view <N> --json title,body,state,labels,assignees,comments --jq .
35+
```
36+
37+
If discussion matters:
38+
39+
```bash
40+
gh issue view <N> --comments
41+
```
42+
43+
**Images in the body**: GitHub stores them as URLs; open or fetch if the visual is required to understand the bug.
44+
45+
## 2. Implement the fix
46+
47+
- Follow the repo’s normal patterns (read surrounding code first; minimal diff).
48+
- Run targeted checks (e.g. `eslint` on touched files, `bun run build` if appropriate). Fix anything **introduced** by the change.
49+
50+
## 3. Summary for GitHub (before commenting)
51+
52+
Draft a short, professional summary the maintainer can skim:
53+
54+
- **What** was wrong (1–2 sentences, tied to the issue).
55+
- **What changed** (bullet list of files or areas; no huge pasted code).
56+
- **How to verify** (e.g. steps or pages to open).
57+
- Optional: **Follow-ups** only if truly out of scope.
58+
59+
Do **not** include secrets, tokens, `.env` values, or internal-only URLs in the comment.
60+
61+
## 4. Post the comment on the issue
62+
63+
Post the summary as an **issue comment** (does not close the issue unless the user asked to close it).
64+
65+
**Option A — body from stdin:**
66+
67+
```bash
68+
gh issue comment <N> --body "$(cat <<'EOF'
69+
## Summary
70+
71+
[your markdown here]
72+
EOF
73+
)"
74+
```
75+
76+
**Option B — file:**
77+
78+
Write the body to a temp file, then:
79+
80+
```bash
81+
gh issue comment <N> --body-file /path/to/comment.md
82+
```
83+
84+
Prefer markdown headings (`##`) and bullets for readability.
85+
86+
## 5. Close the issue (only if asked)
87+
88+
If the user explicitly wants the issue closed after the fix:
89+
90+
```bash
91+
gh issue close <N> --comment "Fixed in [branch/PR description]. See comment above for details."
92+
```
93+
94+
Otherwise leave it **open** for human review or PR merge.
95+
96+
## Checklist
97+
98+
- [ ] Fetched issue with `gh issue view` (and JSON/comments if needed).
99+
- [ ] Implemented and validated the change locally.
100+
- [ ] Wrote a concise summary (no secrets).
101+
- [ ] Posted `gh issue comment <N>`.
102+
- [ ] Closed the issue only if the user requested it.

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,21 @@ This project adheres to [Semantic Versioning](https://semver.org/).
66

77
---
88

9+
## v1.5.0 — 2026-04-01
10+
11+
### ✨ Features
12+
- feat: enhance NavbarActions with dropdown menu for creating new entries (eb652b2)
13+
- feat: add unpublished article notice and draft byline support (4528d1a)
14+
- feat: enhance profile page with additional user information and improved article loading states (2458ad7)
15+
- feat: improve user profile experience with enhanced data display and loading states (3dedc30)
16+
- feat: enhance user profile with additional fields and improved loading states (2db6598)
17+
- feat: improve user avatar handling and display in LatestUsers component (ea1fe57)
18+
19+
### 🔧 Other Changes
20+
- refactor: update theme handling and improve layout structure (524ebc4)
21+
22+
---
23+
924
## v1.4.0 — 2026-03-30
1025

1126
### ✨ Features

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "techdiary.dev-next",
3-
"version": "1.4.0",
3+
"version": "1.5.0",
44
"private": true,
55
"scripts": {
66
"dev": "next dev --turbo",
@@ -58,7 +58,6 @@
5858
"meilisearch": "^0.51.0",
5959
"modern-screenshot": "^4.6.8",
6060
"next": "^16.2.1",
61-
"next-themes": "^0.4.6",
6261
"pg": "^8.14.1",
6362
"react": "^19",
6463
"react-advanced-cropper": "^0.20.1",

src/app/[username]/(profile-page)/_components/ProfilePageAside.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,13 @@ const ProfilePageAside: React.FC<ProfilePageAsideProps> = ({ profile }) => {
4343
<p className="my-2 text-sm text-muted-foreground">{profile?.bio}</p>
4444
)}
4545

46+
{profile?.skills && (
47+
<p className="my-2 text-sm">
48+
<span className="font-medium text-foreground">Skills: </span>
49+
<span className="text-muted-foreground">{profile.skills}</span>
50+
</p>
51+
)}
52+
4653
{/* User infos start */}
4754
<div className="flex flex-col mt-4 gap-2 md:gap-4">
4855
{profile?.website_url && (

src/app/[username]/(profile-page)/articles/UserArticleFeed.tsx

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,22 @@
11
"use client";
22

3-
import { useInfiniteQuery, useQuery } from "@tanstack/react-query";
3+
import { useInfiniteQuery } from "@tanstack/react-query";
44
import * as articleActions from "@/backend/services/article.actions";
55
import React, { useMemo } from "react";
66
import ArticleCard from "@/components/ArticleCard";
77
import { readingTime } from "@/lib/utils";
88
import VisibilitySensor from "@/components/VisibilitySensor";
99
import getFileUrl from "@/utils/getFileUrl";
10+
import { useTranslation } from "@/i18n/use-translation";
11+
import Image from "next/image";
1012

1113
interface UserArticleFeedProps {
1214
userId: string;
1315
}
1416

1517
const UserArticleFeed: React.FC<UserArticleFeedProps> = ({ userId }) => {
18+
const { _t } = useTranslation();
19+
1620
const feedInfiniteQuery = useInfiniteQuery({
1721
queryKey: ["user-article-feed", userId],
1822
queryFn: ({ pageParam }) =>
@@ -42,22 +46,49 @@ const UserArticleFeed: React.FC<UserArticleFeedProps> = ({ userId }) => {
4246
});
4347

4448
const feedArticles = useMemo(() => {
45-
return feedInfiniteQuery.data?.pages.flatMap((page) => page?.nodes);
49+
return feedInfiniteQuery.data?.pages.flatMap((page) => page?.nodes) ?? [];
4650
}, [feedInfiniteQuery.data]);
4751

52+
const showEmpty =
53+
!feedInfiniteQuery.isPending &&
54+
!feedInfiniteQuery.isError &&
55+
feedArticles.length === 0;
56+
4857
return (
4958
<>
50-
{feedInfiniteQuery.isFetching && (
59+
{feedInfiniteQuery.isPending && (
5160
<div className="flex flex-col gap-10 pt-4">
5261
{Array.from({ length: 6 }).map((_, index) => (
5362
<div key={index} className="h-56 bg-muted animate-pulse mx-4" />
5463
))}
5564
</div>
5665
)}
5766

58-
{/* <pre>{JSON.stringify(feedArticles, null, 2)}</pre> */}
67+
{feedInfiniteQuery.isError && (
68+
<div className="py-10 px-4 text-center text-sm text-muted-foreground">
69+
{_t("Could not load articles.")}
70+
</div>
71+
)}
72+
73+
{showEmpty && (
74+
<div className="py-10 flex flex-col items-center justify-center gap-4 px-4">
75+
<Image
76+
src="/images/robots-drones-artificial-intelligence-1.png"
77+
alt=""
78+
width={220}
79+
height={220}
80+
className="mx-auto opacity-90"
81+
/>
82+
<h2 className="text-xl font-semibold text-center">
83+
{_t("No articles published yet")}
84+
</h2>
85+
<p className="text-sm text-muted-foreground text-center max-w-md">
86+
{_t("When this user publishes articles, they will show up here.")}
87+
</p>
88+
</div>
89+
)}
5990

60-
{feedArticles?.map((article) => (
91+
{feedArticles.map((article) => (
6192
<ArticleCard
6293
key={article?.id}
6394
id={article?.id ?? ""}

src/app/[username]/(profile-page)/articles/page.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,13 @@ const Page: React.FC<PageProps> = async ({ params }) => {
1111
const username = sanitizedUsername(_params?.username);
1212
const profile = await getUserByUsername(username, ["id", "username"]);
1313

14+
if (!profile?.id) {
15+
return null;
16+
}
17+
1418
return (
1519
<main className="border rounded-bl-2xl rounded-br-2xl md:col-span-9 col-span-full mt-3">
16-
{/* <pre>{JSON.stringify(profile, null, 2)}</pre> */}
17-
<UserArticleFeed userId={profile?.id!} />
20+
<UserArticleFeed userId={profile.id} />
1821
</main>
1922
);
2023
};

src/app/[username]/(profile-page)/layout.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,21 @@ const layout: React.FC<ProfilePageLayoutProps> = async ({
4747
const _params = await params;
4848
const username = sanitizedUsername(_params?.username);
4949
const profile = await getUserByUsername(username, [
50-
// all fields
5150
"id",
5251
"name",
5352
"username",
5453
"email",
5554
"profile_photo",
55+
"bio",
56+
"designation",
57+
"website_url",
58+
"education",
59+
"location",
60+
"social_links",
61+
"skills",
62+
"is_verified",
5663
"created_at",
5764
"updated_at",
58-
"social_links",
5965
]);
6066

6167
if (!profile) {

0 commit comments

Comments
 (0)