Skip to content

bring back a button to create new words from an empty search#2348

Merged
hahn-kev merged 4 commits into
developfrom
allow-creating-works-from-search
Jun 15, 2026
Merged

bring back a button to create new words from an empty search#2348
hahn-kev merged 4 commits into
developfrom
allow-creating-works-from-search

Conversation

@hahn-kev

Copy link
Copy Markdown
Collaborator

I was looking throught some feedback and someone mentioned wanting to create missing entries from search. We had that feature before we adopted shadcn, so I brought it back.

Search with no results:
Screenshot 2026-06-10 at 12-09-49

Search with results:
Screenshot 2026-06-10 at 12-10-49

the create button is included inline so when the list scrolls it'll be at the bottom.

After I implemented this however, it did feel a bit redundant to have both the add button, and the create button for the search. We could just make the add button use the search for the headword, but I don't think that would be very obvious that this is what would happen.

@github-actions github-actions Bot added the 💻 FW Lite issues related to the fw lite application, not miniLcm or crdt related label Jun 10, 2026
@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 172c56e4-52e6-4214-a2eb-f7bf9de0300e

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

EntriesList.svelte now integrates view-service translations and enables search-driven entry creation. The component imports useViewService and the pt helper, instantiates a viewService instance, and updates the entry creation handler to accept an optional headword parameter. Empty-state and virtual-list rendering are refactored to use view-specific text and display a "create entry for search" button as a final list item when appropriate.

Changes

View-aware entry creation and search-driven button

Layer / File(s) Summary
View-service translation setup
frontend/viewer/src/project/browse/EntriesList.svelte
Imports useViewService and pt helper, then instantiates viewService for rendering view-specific text throughout the component.
Entry creation handler and list indexing
frontend/viewer/src/project/browse/EntriesList.svelte
handleNewEntry function signature updates to accept an optional headword argument; virtual list initialization extends the data range by one slot for the search-driven button; new-entry button handler invokes handleNewEntry() instead of passing the function reference.
Empty-state rendering with view-specific text
frontend/viewer/src/project/browse/EntriesList.svelte
Empty-state messages now use pt with viewService.currentView for view-specific translations; when search is present, a button appears that calls handleNewEntry(search) to create a new entry with that search term.
Virtual list with search-driven creation button
frontend/viewer/src/project/browse/EntriesList.svelte
Virtual list rendering reserves the final index as a conditional "create new entry for search" button (shown only when search exists and totalCount is non-zero); all other indices continue to use Delayed loading with skeleton rendering and loaded EntryRow display.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Suggested labels

💻 FW Lite

Poem

🐰 A list once plain now sees the view,
With search-born entries sparkling new,
The final slot births items fine,
When headwords in the query align! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: reintroducing a button to create new entries from search queries, which is the primary feature added in this PR.
Description check ✅ Passed The description is clearly related to the changeset, explaining the context of the feature (previously removed), showing screenshots of the implementation, and discussing design considerations about redundancy.
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 unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch allow-creating-works-from-search

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.

@github-actions

github-actions Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

UI unit Tests

  1 files  ±0   62 suites  ±0   27s ⏱️ -3s
186 tests ±0  186 ✅ ±0  0 💤 ±0  0 ❌ ±0 
258 runs  ±0  258 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 2e54d34. ± Comparison against base commit 248ea03.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

C# Unit Tests

165 tests   165 ✅  12s ⏱️
 23 suites    0 💤
  1 files      0 ❌

Results for commit 2e54d34.

♻️ This comment has been updated with latest results.

@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/viewer/src/project/browse/EntriesList.svelte`:
- Around line 108-111: The inline create-entry buttons bypass disableNewEntry
and indexArray always reserves a terminal CTA slot; update the logic so creation
UI is fully gated by disableNewEntry and no extra slot is reserved when creation
is disabled. Specifically: change the indexArray computation (uses
entryLoader?.totalCount and skeletonRowCount) to subtract the terminal CTA slot
when disableNewEntry is true so no extra index is reserved; and wrap rendering
of all creation controls (the FAB and the inline create-entry buttons) with a
check on disableNewEntry so they do not render when disableNewEntry is true. Use
the existing symbols disableNewEntry, indexArray, entryLoader, and
skeletonRowCount to locate and modify the code paths.
🪄 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: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 7c17677e-f085-48e8-96c5-24de6db19d5b

📥 Commits

Reviewing files that changed from the base of the PR and between 4ccd57f and 9e947ed.

📒 Files selected for processing (1)
  • frontend/viewer/src/project/browse/EntriesList.svelte

Comment thread frontend/viewer/src/project/browse/EntriesList.svelte Outdated
@argos-ci

argos-ci Bot commented Jun 11, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
default (Inspect) ✅ No changes detected - Jun 12, 2026, 1:24 PM

@myieye

myieye commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

Here's what I pushed. What do you think?

image image image image

Hovered

image

Focused

image

@myieye myieye force-pushed the allow-creating-works-from-search branch from ed6c8c0 to 2e54d34 Compare June 12, 2026 13:21

@myieye myieye left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Great idea!

@hahn-kev hahn-kev merged commit 94af62c into develop Jun 15, 2026
27 checks passed
@hahn-kev hahn-kev deleted the allow-creating-works-from-search branch June 15, 2026 03:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

💻 FW Lite issues related to the fw lite application, not miniLcm or crdt related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants