Repository navigation
Focus the title of a new or copied section, and of a copied site - #672
Conversation
…ed site - "Create new section" and a section's "copy" open the new section (/sections/<name>?section=<name>): its settings, its page in the preview, and its title input focused and scrolled into view. Going from /sections to /sections/:section replaces the sections list, so the section to focus is kept on the component class. - A site's "copy" switches to the copy and focuses its title. "Create new site" still opens the setup wizard. - Empty section and site titles show a "Section title" / "Site title" placeholder, also after the text is cleared. - CloneSectionAction returns its dispatch, so the copy is in the store when the action completes. - Tests: inline text input placeholder and startEditing(), section create/copy and site copy navigation and focus. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Inline title input behavior editor/src/app/inputs/inline-text-input.component.ts, editor/src/app/inputs/inline-text-input.component.spec.ts |
The input displays its value, placeholder, or .... It exposes startEditing() and applies an is-empty class when the value is falsy. Tests cover display and focus behavior. |
Site creation, cloning, and title focus editor/src/app/sites/site.component.ts, editor/src/app/sites/sites.component.ts, editor/src/app/sites/sites.component.spec.ts |
Site components emit clone events. SitesComponent identifies the new site after dispatch, navigates to it, and focuses its title input. Creation uses the same new-site lookup and navigation flow. |
Section creation, cloning, and title focus editor/src/app/sites/sections/section.component.ts, editor/src/app/sites/sections/site-sections.component.ts, editor/src/app/sites/sections/sections-state/site-sections.state.ts, editor/src/app/sites/sections/site-sections.component.spec.ts |
Section components emit clone events. SiteSectionsComponent opens the created or cloned section and focuses its title input. cloneSection returns the action dispatch result. |
Priority:
Estimated code review effort: 3 (Moderate) | ~25 minutes
Change: Feature
Sequence Diagram(s)
sequenceDiagram
actor User
participant SiteComponent
participant SitesComponent
participant NGXSStore
participant Router
participant InlineTextInputComponent
User->>SiteComponent: Click copy
SiteComponent->>SitesComponent: Emit clone event with site model
SitesComponent->>NGXSStore: Dispatch clone action and read updated sites
NGXSStore-->>SitesComponent: Return newly added site
SitesComponent->>Router: Navigate to new site
SitesComponent->>SiteComponent: Focus title after navigation and render
SiteComponent->>InlineTextInputComponent: Start title editing
Suggested reviewers: blackwolfie, vteivans
Merge Risk: 
Minimal · up to 27ee3
-
No new issue requiring a fix before merge was established.
Pre-merge checks: 
5
-
Full details: Title check
-
Explanation
The title names the main behavior change: a new or copied section, and a copied site, now get their title focused. The changeset adds section and site title focus after creation or copy, and moves clone handling into the list components, so the title matches the primary change. It does not mention the placeholder and startEditing() additions, which is acceptable because the title does not need to cover every detail.
Full details: Docstring Coverage
-
Explanation
No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 9 files.
-
Finishing Touches
-
📝 Generate docstrings
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
Comment @coderabbitai help to get the list of available commands.
After creating or copying a section, or copying a site, the editor puts the cursor straight into the new item's title. You no longer have to find it at the bottom of the list and click its edit icon.
What changes for editors
/sections/<name>?section=<name>. That opens the section's settings and loads its page in the preview. The title input is focused and scrolled into view.?site=<name>), scrolls to it and focuses its title. "Create new site" still opens the setup wizard.Notes for review
/sectionsand/sections/:sectionare separate routes, so opening a new section from/sectionsreplacesSiteSectionsComponent. The router starts the new instance only after the navigation has finished, so the navigation'sstateis no longer available to it. Instead, the section to focus is kept in a static field and only used when the shown section matches it, so a reload or the back button doesn't refocus.CloneSectionActionnow returns its dispatch. Before, its observable completed before the copy was in the store.SectionComponent/SiteComponentup to the lists. The rows emitclone, as they already emitupdatefor edits.SitesComponent.addSite()is shared by create and clone.Tests
inline-text-input.component.spec.ts: placeholder text andstartEditing().site-sections.component.spec.ts: create from/sectionsand copy from/sections/home, with the real router. It checks the URL and the focused title input. The create case fails without the fix.sites.component.spec.ts: copy site, URL and focus.npx ng test --watch=false --browsers=ChromeHeadless: 197 pass.npm run buildpasses.🤖 Generated with Claude Code
Summary by CodeRabbit