Repository navigation
feat(app): add InlineNameInput as the one way to name objects - #3278
Conversation
Replace EditablePageName (pencil button, double-click, "Save Name") with a field that looks like the title and edits in place. Saved objects commit on Enter or blur; drafts use the controlled variant and save with their form. Document the pattern in agent_docs/naming_objects.md, a naming-objects skill, and Storybook (Guidelines/Naming objects, Components/InlineNameInput). Co-authored-by: Cursor <cursoragent@cursor.com>
Replace the "Chart Name" label and input with the inline name field. Swap the lg/sm sizes for xs, sm (default), and md, and use md for page titles so dashboard and saved search names are smaller. Co-authored-by: Cursor <cursoragent@cursor.com>
The chart editor layout needs rework before the inline name field fits. Co-authored-by: Cursor <cursoragent@cursor.com>
🦋 Changeset detectedLatest commit: 6a57642 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🟡 Tier 3 — StandardIntroduces new logic, modifies core functionality, or touches areas with non-trivial risk. Why this tier:
Review process: Full human review — logic, architecture, edge cases. Stats
|
Duplicate code analysisNo new duplicate code introduced by this PR. jscpd compared this branch against |
PR Review
4 finding(s): 🔴 0 critical · 🟠 0 major · 🔵 4 minor 2 posted as inline comment(s) on the changed lines. 2 listed below. Findings outside the changed lines2 minor
Severity is the reviewer's own estimate and is used for ordering, not filtering. No finding blocks merge automatically; a maintainer decides. |
|
Deep Review✅ No critical issues found. This is a focused, well-tested refactor: a new No P2 issues rise above a transient/edge-case bar once re-graded against concrete failure modes in this diff. 🔵 P3 nitpicks (3)
Reviewers (8): correctness, testing, maintainability, project-standards, kieran-typescript, julik-frontend-races, adversarial, previous-comments. Testing gaps:
No finding blocks merge automatically. A maintainer will expect P0/P1 findings in code this PR changes to be fixed; P2/P3 are your call -- fix or reply. Never fix findings about surrounding code here; reply instead. Do not widen the PR. How to respond |
E2E Test Results✅ All tests passed • 394 passed • 1 skipped • 1296s
Tests ran across 4 shards in parallel. |
Co-authored-by: Cursor <cursoragent@cursor.com>
The field dropped the draft as soon as it committed, so the old name flashed for the whole request. It now holds the typed name until the saved value arrives, and reverts when the save fails. Co-authored-by: Cursor <cursoragent@cursor.com>
The heading wrapped only an input, so its accessible name was the input's label. It now carries the current name, and the heading tag is chosen without a cast. Co-authored-by: Cursor <cursoragent@cursor.com>
The heading wraps an input, so toHaveText never sees the name. The two Terraform-gate tests now check the field value. Enter during IME composition no longer commits. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Addressed the latest review on
Left as they are:
|
| size="md" | ||
| headingLevel={3} | ||
| data-testid="dashboard-name-input" | ||
| onCommit={editedName => { |
There was a problem hiding this comment.
🔵 minor — Renaming before the dashboard loads leaves a name on screen that was never saved
When dashboard is still undefined (loading, or the id is not found), onCommit returns undefined. InlineNameInput then keeps pending set to the typed name until value changes, so the title shows a name that was never saved. This is the opposite of the 'visibly reverts' behaviour the component promises. Return Promise.reject(new Error('Dashboard not loaded')) here, or make the input readOnly until dashboard exists.
Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond
| level: 3, | ||
| // The document title comes from the saved dashboard, so it only changes | ||
| // once the rename has persisted. | ||
| const escaped = newName.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); |
There was a problem hiding this comment.
🔵 minor — Inline regex-escape duplicates lodash escapeRegExp, which is already used in the app
Replace the inline .replace(/[.*+?^${}()|[\]\\]/g, '\\$&') with import { escapeRegExp } from 'lodash', as packages/app/src/components/KubernetesFilters.tsx does. This copy is now the third: utils/materializedViews.ts and components/deltaChartUtils.ts each have their own private escapeRegExp.
Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond
Summary
Users name things in several different ways today: dashboards and saved searches use a click-to-edit title (hover for a pencil or double-click, then a "Save Name" button), and other places use a bordered text field. This PR adds one shared component,
InlineNameInput, and documents it as the single pattern for naming objects.How it behaves
InlineNameInput): Enter or clicking away saves, Escape or an empty name reverts. After a commit it shows the saved value, so a rename that fails or gets overwritten by a concurrent dashboard save visibly reverts instead of leaving a name that was never saved.InlineNameInputControlled): a react-hook-form field that saves with the surrounding form. Not used in the app yet; it's meant for the full-page tile editor.xs,sm(default),md. Page titles usemd(18px, down from the previous ~22px heading).headingLevel={3}) so screen readers andgetByRole('heading')still find it.Changes
InlineNameInput;EditablePageNameis deleted.agent_docs/naming_objects.md, anaming-objectsagent skill, and Storybook pages (Guidelines/Naming objects, Components/InlineNameInput). Linked fromAGENTS.md, the agent_docs README, andcode_style.md.The chart editor keeps its existing "Chart Name" field for now; it needs a layout change before the inline field fits.
Screenshots or video
See Storybook → Components/InlineNameInput (saved object, long name, draft in an editor header, and all sizes).
How to test on Vercel preview
Preview routes: /dashboards/list
Steps:
References
elizabet/dashboard-tile-editor-page), which will adoptInlineNameInputControlledin its header