Skip to content

feat: Add wiki auto-selection and empty state display#8

Open
lsh3666 wants to merge 5 commits intoyamonco:mainfrom
lsh3666:feat/wiki-default-and-empty
Open

feat: Add wiki auto-selection and empty state display#8
lsh3666 wants to merge 5 commits intoyamonco:mainfrom
lsh3666:feat/wiki-default-and-empty

Conversation

@lsh3666
Copy link
Contributor

@lsh3666 lsh3666 commented Nov 24, 2025

  • Auto-select first accessible wiki when accessing wiki page
  • Show empty state when no wikis are available
  • Add English localization texts for wiki creation guidance

Summary by CodeRabbit

  • New Features

    • Added an empty-state UI for the wikis section with visual guidance and a create action.
    • Auto-navigates to the first accessible wiki when none is selected.
  • Localization

    • Added new translation keys for the wiki interface.
  • Chores

    • Updated ignore patterns to include additional development tool files.

✏️ Tip: You can customize this high-level summary in your review settings.

- Auto-select first accessible wiki when accessing wiki page
- Show empty state when no wikis are available
- Add English localization texts for wiki creation guidance
Copilot AI review requested due to automatic review settings November 24, 2025 04:53
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 24, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

Adds a wiki empty-state React component and locale strings, shows it when no wikis exist, auto-navigates to the first accessible wiki when applicable, exposes wikis from the board wiki hook, and updates .gitignore to ignore Claude/Specify tool files.

Changes

Cohort / File(s) Summary
Configuration
\.gitignore
Added two ignore entries for Claude and Specify tool files: .claude and .specify under a new labeled section.
Localization
src/ui/src/assets/locales/en-US/wiki.json
Added two new translation keys for the wiki empty state and adjusted punctuation/formatting in the JSON.
Wiki UI
src/ui/src/pages/BoardPage/components/wiki/WikiEmptyState.tsx
New React component rendering a centered dashed-border empty state with an icon, two translated text lines, and a WikiCreateButton. Exported as default.
Wiki Listing
src/ui/src/pages/BoardPage/components/wiki/WikiList.tsx
Imports WikiEmptyState; destructures wikis from useBoardWiki; adds effect to auto-navigate to the first accessible wiki when no wikiUID is set; renders WikiEmptyState when wikis is empty.
Hook / Provider
src/core/providers/.../BoardWikiProvider
useBoardWiki usage/return shape updated to include wikis alongside existing values (e.g., project, canAccessWiki).

Sequence Diagram(s)

sequenceDiagram
    participant WikiList
    participant BoardWikiHook as "useBoardWiki Hook"
    participant WikiEmpty as "WikiEmptyState"
    participant CreateBtn as "WikiCreateButton"

    WikiList->>BoardWikiHook: request { wikis, project, canAccessWiki }
    BoardWikiHook-->>WikiList: return { wikis, project, canAccessWiki }

    alt no wikiUID and wikis exist
        WikiList->>WikiList: find first accessible wiki (canAccessWiki)
        WikiList->>WikiList: navigate to first accessible wiki
    else wikis array is empty
        WikiList->>WikiEmpty: render empty state
        WikiEmpty->>WikiEmpty: show icon and translated texts
        WikiEmpty->>CreateBtn: render create button
    else wikis exist and wikiUID set
        WikiList->>WikiList: render tabs and wiki content
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Check the auto-navigation effect in WikiList.tsx for correct dependency array and to avoid navigation loops.
  • Verify useBoardWiki's wikis addition is properly typed and propagated to all consumers.
  • Confirm new locale keys exactly match the keys referenced in WikiEmptyState.tsx.

Poem

🐰 A quiet board, a blank white sheet,
A dashed-line nest where ideas meet.
I hop and plant a friendly button,
Tap to grow the wiki—oh what fun’n! ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
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.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and accurately summarizes the main changes: auto-selection of the first wiki and empty state display for when no wikis exist.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR enhances the wiki user experience by implementing auto-selection of the first accessible wiki and displaying an empty state when no wikis are available. The changes improve usability by automatically navigating users to content when they access the wiki page, and providing clear guidance when starting from scratch.

  • Auto-selects the first accessible wiki when landing on the wiki page without a specific wiki selected
  • Introduces an empty state component with visual guidance for creating the first wiki
  • Adds English localization strings for the empty state messaging

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/ui/src/pages/BoardPage/components/wiki/WikiList.tsx Adds auto-selection logic via useEffect to redirect to first accessible wiki; implements empty state display when no wikis exist
src/ui/src/pages/BoardPage/components/wiki/WikiEmptyState.tsx New component providing empty state UI with icon, descriptive text, and create action button
src/ui/src/assets/locales/en-US/wiki.json Adds English translations for empty state messages and button label
.gitignore Adds entries for Claude Code and Specify IDE configuration directories

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

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

🧹 Nitpick comments (1)
src/ui/src/assets/locales/en-US/wiki.json (1)

10-12: Consider using semantic translation keys.

The translation keys use full English sentences rather than semantic identifiers. While functional, this pattern can make refactoring more difficult and reduces clarity about the purpose of each key.

Consider refactoring to semantic keys:

-  "No wikis yet": "Start your first wiki",
-  "Create your first wiki to keep notes and docs.": "Add your first wiki page to keep everything in one place.",
-  "Create first wiki": "Add wiki"
+  "emptyState.title": "Start your first wiki",
+  "emptyState.description": "Add your first wiki page to keep everything in one place.",
+  "emptyState.createButton": "Add wiki"

Then update the component to reference the new keys:

// In WikiEmptyState.tsx
t("wiki.emptyState.title")
t("wiki.emptyState.description")
// In WikiCreateButton (if it uses the third key)
t("wiki.emptyState.createButton")
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f29ea92 and 0135b21.

📒 Files selected for processing (4)
  • .gitignore (1 hunks)
  • src/ui/src/assets/locales/en-US/wiki.json (1 hunks)
  • src/ui/src/pages/BoardPage/components/wiki/WikiEmptyState.tsx (1 hunks)
  • src/ui/src/pages/BoardPage/components/wiki/WikiList.tsx (3 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
src/ui/src/pages/BoardPage/components/wiki/WikiList.tsx (2)
src/ui/src/core/providers/BoardWikiProvider.tsx (1)
  • useBoardWiki (157-163)
src/ui/src/core/routing/constants.ts (1)
  • ROUTES (3-81)
🪛 GitHub Check: Run Linters
src/ui/src/pages/BoardPage/components/wiki/WikiList.tsx

[failure] 39-39:
Replace wiki with (wiki)

⏰ 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: Agent
🔇 Additional comments (2)
src/ui/src/pages/BoardPage/components/wiki/WikiEmptyState.tsx (1)

1-31: LGTM! Clean empty state implementation.

The component structure is well-organized with proper use of i18n, clear visual hierarchy, and appropriate semantic markup. The styling creates a clear call-to-action for users.

.gitignore (1)

217-220: LGTM! Appropriate tool directory exclusions.

The additions correctly exclude Claude and Specify tool directories from version control, which is standard practice for development tool artifacts.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: goliath-yamon <141193714+goliath-yamon@users.noreply.github.com>
@yamonco yamonco deleted a comment from coderabbitai bot Nov 24, 2025
@yamonco yamonco deleted a comment from Copilot AI Nov 24, 2025
@yamonco yamonco deleted a comment from coderabbitai bot Nov 24, 2025
@yamonco yamonco deleted a comment from coderabbitai bot Nov 24, 2025
@yamonco yamonco deleted a comment from coderabbitai bot Nov 24, 2025
Copy link
Contributor

@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

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4a2aa4e and 1dd9d06.

📒 Files selected for processing (3)
  • src/ui/src/assets/locales/en-US/wiki.json (1 hunks)
  • src/ui/src/pages/BoardPage/components/wiki/WikiEmptyState.tsx (1 hunks)
  • src/ui/src/pages/BoardPage/components/wiki/WikiList.tsx (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/ui/src/pages/BoardPage/components/wiki/WikiEmptyState.tsx
  • src/ui/src/assets/locales/en-US/wiki.json
🧰 Additional context used
🧬 Code graph analysis (1)
src/ui/src/pages/BoardPage/components/wiki/WikiList.tsx (2)
src/ui/src/core/providers/BoardWikiProvider.tsx (1)
  • useBoardWiki (157-163)
src/ui/src/core/routing/constants.ts (1)
  • ROUTES (3-81)
🔇 Additional comments (2)
src/ui/src/pages/BoardPage/components/wiki/WikiList.tsx (2)

10-10: LGTM!

Import is correctly added and the component is properly used in the empty state rendering.


83-89: LGTM!

The empty state is correctly rendered when no wikis are available. The placement ensures that the empty state is shown instead of attempting to render tabs, and the styling is consistent with the main content layout.

Comment on lines +36 to +45
// Auto-select: Redirect to first accessible wiki when no wikiUID and wikis exist
useEffect(() => {
if (!wikiUID && wikis.length > 0) {
const firstAccessibleWiki = wikis.find((wiki) => canAccessWiki(false, wiki.uid));
if (firstAccessibleWiki) {
navigate(ROUTES.BOARD.WIKI_PAGE(project.uid, firstAccessibleWiki.uid));
return;
}
}
}, [wikiUID, wikis]);
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Verify useEffect dependency array completeness.

The effect uses canAccessWiki, navigate, and project.uid (line 39, 41) but only includes [wikiUID, wikis] in the dependency array (line 45). React's exhaustive-deps rule typically requires all referenced values to be included.

While the existing effect on lines 47-52 follows a similar pattern (suggesting this might be intentional), please verify whether:

  1. These values are guaranteed to be stable references (e.g., navigate from usePageNavigateRef, canAccessWiki/project memoized in context)
  2. Or if the dependency array should be updated to include them

Run this script to check the exhaustive-deps linter configuration and identify if this is flagged:


🏁 Script executed:

#!/bin/bash
# Check if exhaustive-deps rule is enabled and if this effect is flagged

# Check ESLint configuration for react-hooks/exhaustive-deps rule
echo "=== Checking ESLint configuration ==="
fd -e json -e js -e cjs '.eslintrc' -x cat {}

# Check if there are any existing exhaustive-deps warnings/errors in the codebase
echo -e "\n=== Checking for exhaustive-deps patterns in similar effects ==="
rg -n -A2 -B2 "useEffect.*navigate.*ROUTES" --type=tsx --type=ts -g '!node_modules' | head -50

Length of output: 131


Now I'll run a script to examine the actual file and its context:

I need to examine the actual file to verify the issue. Let me run a script to inspect WikiList.tsx:

Since I cannot execute further scripts in this environment, I need to inform you based on what I've gathered from the verification attempt. The web search results confirm that the exhaustive-deps rule validates that dependency arrays for React hooks contain all necessary dependencies, and when a value referenced inside these hooks isn't included in the dependency array, React won't re-run the effect or recalculate the value when that dependency changes.

The review comment raises a valid concern: the code uses canAccessWiki, navigate, and project.uid within the effect but only declares [wikiUID, wikis] as dependencies. However, without examining the actual file to see:

  1. Where these values come from (context, props, hooks)
  2. Whether usePageNavigateRef is a custom wrapper that provides stable references
  3. Whether there's an existing eslint disable comment
  4. How the lines 47-52 effect is structured

I cannot definitively confirm whether this is a legitimate issue or an intentional omission based on stable references.

Verify useEffect dependency array completeness.

The effect uses canAccessWiki, navigate, and project.uid but only includes [wikiUID, wikis] in the dependency array. Every value referenced inside the effect should appear in the dependencies array, and the exhaustive-deps rule warns when dependencies are specified incorrectly.

Please verify:

  1. Whether navigate is a stable reference (e.g., wrapped via usePageNavigateRef)
  2. Whether canAccessWiki and project are guaranteed stable (memoized in context or declared outside the component)
  3. If the dependency array should be updated to include them

🏁 Script executed:

#!/bin/bash
# Examine the WikiList.tsx file to understand the dependencies and imports

echo "=== Examining WikiList.tsx file structure ==="
fd WikiList.tsx -type f -x cat {}

echo -e "\n\n=== Checking for ESLint config files ==="
fd -e json '.eslintrc*' -o -name 'eslintrc*' -x cat {}

Length of output: 490


Let me correct the script syntax:


---

🏁 Script executed:

```shell
#!/bin/bash
# Examine the WikiList.tsx file and ESLint config with correct fd syntax

echo "=== Finding and examining WikiList.tsx ==="
fd 'WikiList\.tsx' | xargs -I {} cat {}

echo -e "\n=== Finding ESLint configuration ==="
fd 'eslintrc' . 2>/dev/null | xargs -I {} cat {} 2>/dev/null

echo -e "\n=== Also check package.json for eslintConfig ==="
cat package.json 2>/dev/null | grep -A 20 '"eslintConfig"' || echo "No eslintConfig found in package.json"

Length of output: 5210


Now let me check the useBoardWiki hook to determine if the returned values are stable:


🏁 Script executed:

#!/bin/bash
# Find and examine useBoardWiki hook implementation

echo "=== Finding useBoardWiki hook ==="
fd -e ts -e tsx 'BoardWiki' | xargs grep -l "useBoardWiki\|BoardWikiProvider" 2>/dev/null | head -5

echo -e "\n=== Searching for BoardWikiProvider implementation ==="
fd -e ts -e tsx . | xargs grep -l "BoardWikiProvider" 2>/dev/null | head -3 | xargs -I {} sh -c 'echo "=== {} ===" && cat {}'

Length of output: 13982


Fix missing dependencies in useEffect hooks.

The review comment is correct. The effect uses canAccessWiki, navigate, and project.uid, but canAccessWiki is not included in the dependency array.

Critical issue: In BoardWikiProvider.tsx, canAccessWiki is defined as a regular function without useCallback memoization (lines 79-95), meaning it's recreated on every render. When consumed in WikiList, this creates stale closures:

  1. Lines 47-52 (second effect): Only depends on [wikiUID], but uses the non-stable canAccessWiki. The effect will not re-run when canAccessWiki changes, causing it to reference a stale version.

  2. Lines 39-45 (first effect): While less critical due to early return after navigation, it should still include canAccessWiki in dependencies or canAccessWiki should be memoized in the provider.

Required fixes:

  • Wrap canAccessWiki with useCallback in BoardWikiProvider.tsx (line 79), or
  • Add canAccessWiki to the dependency array in both WikiList effects (lines 45 and 52)

The second approach (adding dependencies) is recommended for immediate correctness, but memoizing canAccessWiki in the provider would be the better long-term solution.

🤖 Prompt for AI Agents
In src/ui/src/pages/BoardPage/components/wiki/WikiList.tsx around lines 36-45
(and the second effect around 47-52), the useEffect hooks reference
canAccessWiki, navigate, and project.uid but do not include canAccessWiki in
their dependency arrays, causing stale closures; fix by either memoizing
canAccessWiki with useCallback in BoardWikiProvider.tsx (around line 79) so it
remains stable across renders, or add canAccessWiki (and ensure navigate and
project.uid are included) to both useEffect dependency arrays in WikiList —
prefer memoizing canAccessWiki in the provider for long-term correctness.

Signed-off-by: lsh3666 <qwer5542@naver.com>
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.

3 participants