Skip to content

feat(app): home redesign per #151#180

Merged
Astro-Han merged 10 commits into
devfrom
feat/pr1-home-visual-refresh
Apr 23, 2026
Merged

feat(app): home redesign per #151#180
Astro-Han merged 10 commits into
devfrom
feat/pr1-home-visual-refresh

Conversation

@Astro-Han

@Astro-Han Astro-Han commented Apr 23, 2026

Copy link
Copy Markdown
Owner

Summary

Complete home redesign implementing #151. Two layers, one PR:

  1. Visual refresh — home shell typography/spacing, bespoke Skill card icons, composer chrome slimming, model/variant chips move next to Send.
  2. Skill starter reshape — Skill cards no longer create sessions on click; they select locally. Send packages the selected Skill as transient request text routed through promptAsync. Legacy helpers and sidebar Skill badge removed.

No behavior change for non-home submissions. Session view and session composer are untouched aside from the shared submit.ts guards.

Spec

Commits (ten, each one reversible intent)

  1. feat(app): refresh home shell visual per #151 — remove Mark logo, raise title, add reassurance note, fix latent text-24-medium bug.
  2. feat(app): refresh skill card visual and icons per #151 — custom SVG icons (folder / bar-chart / pencil) tinted per Skill; inline pill layout.
  3. feat(app): Skill card selects locally + per-Skill placeholder — click toggles a local signal; placeholder switches per Skill; render-prop ctx of { onModeChange, selectedSkill }.
  4. feat(app): hide agent selector in home composer — hide agent Select in home DockTray; shortcuts untouched.
  5. feat(app): remove sidebar Skill badge — drop session.skill rendering; field stays readable for legacy compatibility.
  6. feat(app): force agent=build and drop agent-required guard on home — home sends always use build; missing agent no longer blocks.
  7. feat(app): home Skill send packages selected Skill as transient textoutgoingTextOverride field on FollowupDraft; Gate 1/4/5/6 relaxations; empty-history skip for Skill-only sends.
  8. refactor(app): delete legacy Skill start path — drop session-new-view-start.ts, session-new-view-command.ts, getPawworkSkillMeta export, e2e badge spec, and session-new-view.test.ts (covered the removed flow). pawwork-skill-meta.test.ts reduced to a card-identity snapshot.
  9. feat(app): home composer moves model/variant chips next to send — home hides top DockTray entirely and surfaces model + variant chips beside the Send button; session keeps the original tray. Composer scroll area min-height raised to 104px for breathing room.
  10. test(app): cover home Skill override logic and placeholder branch — extract buildHomeOverride pure helper, unit-test the Gate 4 outgoing-text contract; extend placeholder.test.ts with the Skill branch and its priority ordering.

Test plan

  • bun run test:unit green (538 pass, 0 fail)
  • bun turbo typecheck green

A. Home visual

  • Title / subtitle / 3 pills / composer / reassurance render as before
  • sidebar legacy sessions no longer show Skill badge

B. Skill selection (UI-3)

  • Click pill toggles selected state; placeholder switches per Skill
  • Switching pills updates selected state and placeholder
  • mod+shift+x shell mode hides selected state; normal restores it
  • composer position stays stable through selection / mode changes

C. Composer chrome (UI-4 + composer layout commit)

  • Home DockTray gone; model + variant chips sit left of Send
  • Home shell mode: only Send button visible on bottom bar
  • Session mode: DockTray intact (agent + model + variant); bottom bar unchanged
  • agent.cycle / model.choose / mode.shell keyboard shortcuts all work

D. Skill-only send (B-1b)

  • Select Skill, no text → Send enabled → user bubble shows /skill-name
  • Prompt history (↑ in composer) has no empty entry

E. Skill + text

  • /skill-name <text> in user bubble; history stores only <text>

F. Skill + slash-like text (Gate 5)

  • /writing-assistant /review this routes through promptAsync, never session.command

G. Agent override (B-1a)

  • With global agent plan, home send still sends agent: "build"
  • Missing persisted agent no longer blocks home send; session sends still require agent

H. Skill + shell mode

  • session.shell receives raw command (no /skill-name prefix)

I. Cleanup

  • No startPawworkSkillSession command palette entries
  • Typing unknown slash command (no Skill selected) behaves same as before

Coverage

  • Unit: buildHomeOverride (Gate 4 text assembly) + promptPlaceholder Skill branch and priority order. See commit 10.
  • Integration / full createPromptSubmit harness: deferred to a follow-up PR. Gate 5 (slash bypass) and Gate 6 (empty-history skip) remain covered by manual verification.

Known limitations

Out of scope / follow-ups

Refs #151

Summary by CodeRabbit

Release Notes

  • New Features

    • Skill selection interface for creating new sessions with enhanced visual skill cards
    • Skill-specific input placeholders to guide users based on selected task type
    • Added reassurance messaging confirming that files and conversations remain locally processed
  • Updates

    • Refreshed UI text and icons for the session creation flow
    • Updated translations for English and Chinese locales

@Astro-Han Astro-Han added enhancement New feature or request P1 High priority ui Design system and user interface labels Apr 23, 2026
@coderabbitai

coderabbitai Bot commented Apr 23, 2026

Copy link
Copy Markdown
Contributor

Warning

Rate limit exceeded

@Astro-Han has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 3 minutes and 8 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 3 minutes and 8 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: f0a70e58-0e2e-46c3-95ff-a7f69621629b

📥 Commits

Reviewing files that changed from the base of the PR and between 05eb77e and d43bc4a.

📒 Files selected for processing (20)
  • packages/app/e2e/sidebar/sidebar-pawwork.spec.ts
  • packages/app/src/components/prompt-input.tsx
  • packages/app/src/components/prompt-input/home-override.test.ts
  • packages/app/src/components/prompt-input/home-override.ts
  • packages/app/src/components/prompt-input/placeholder.test.ts
  • packages/app/src/components/prompt-input/placeholder.ts
  • packages/app/src/components/prompt-input/submit.ts
  • packages/app/src/components/session/pawwork-skill-meta.test.ts
  • packages/app/src/components/session/pawwork-skill-meta.ts
  • packages/app/src/components/session/session-new-view-command.ts
  • packages/app/src/components/session/session-new-view-start.ts
  • packages/app/src/components/session/session-new-view.test.ts
  • packages/app/src/components/session/session-new-view.tsx
  • packages/app/src/components/session/skill-icons.tsx
  • packages/app/src/i18n/en.ts
  • packages/app/src/i18n/zh.ts
  • packages/app/src/pages/layout/sidebar-items.tsx
  • packages/app/src/pages/session.tsx
  • packages/app/src/pages/session/composer/session-composer-region.tsx
  • packages/app/src/shell-frame-contract.test.ts
📝 Walkthrough

Walkthrough

Redesigns the PawWork home/task-starter: adds typed SVG skill icons and per-card home icon metadata, moves skill selection into NewSessionView (exposing composer context), forwards selection/mode into PromptInput and submit logic (home-override), removes prior session-start helpers and related E2E tests. (50 words)

Changes

Cohort / File(s) Summary
Skill icon + metadata
packages/app/src/components/session/skill-icons.tsx, packages/app/src/components/session/pawwork-skill-meta.ts
Add SkillIcon component and SkillIconName type; extend pawworkSkillCards with homeIcon/homeIconClass; update some iconName values; remove getPawworkSkillMeta.
Session starter UI
packages/app/src/components/session/session-new-view.tsx, packages/app/src/components/session/session-new-view-start.ts, packages/app/src/components/session/session-new-view-command.ts
Move skill selection into NewSessionView, expose composer context (onModeChange, selectedSkill); delete helpers that built/started Pawwork skill sessions (buildSkillSessionCommandInput, startPawworkSkillSession).
Composer / Prompt plumbing
packages/app/src/pages/session.tsx, packages/app/src/pages/session/composer/session-composer-region.tsx, packages/app/src/components/prompt-input.tsx, packages/app/src/components/prompt-input/placeholder.ts, packages/app/src/components/prompt-input/submit.ts, packages/app/src/components/prompt-input/home-override.ts, packages/app/src/components/prompt-input/home-override.test.ts
Forward mode and selectedSkill into composer/prompt; PromptInput gains onModeChange/selectedSkill; placeholder uses skill-specific i18n; submit flow adds outgoingTextOverride, supports home-skill submissions (agent forced to build, skip slash parsing, allow empty text for home-skill).
Localization
packages/app/src/i18n/en.ts, packages/app/src/i18n/zh.ts
Update session.new.subtitle; add session.new.reassurance and three skill-specific placeholder strings for the new-session flow.
Sidebar / session row
packages/app/src/pages/layout/sidebar-items.tsx
Remove getPawworkSkillMeta usage and the session skill badge rendering in SessionRow.
Tests / E2E
packages/app/e2e/sidebar/sidebar-pawwork.spec.ts, packages/app/src/components/session/pawwork-skill-meta.test.ts, packages/app/src/components/session/session-new-view.test.ts, packages/app/src/components/session/session-new-view-command.ts, packages/app/src/components/prompt-input/placeholder.test.ts, packages/app/src/components/prompt-input/home-override.test.ts
Delete Playwright sidebar tests; update unit tests to reflect removal of getPawworkSkillMeta and deleted start/command helpers; add tests for buildHomeOverride and placeholder behavior.
Contract test tweak
packages/app/src/shell-frame-contract.test.ts
Weakened string assertions around renderComposerRegion declaration to simpler, split expectations.

Sequence Diagram(s)

sequenceDiagram
  participant User as User
  participant NewView as NewSessionView
  participant Composer as SessionComposerRegion
  participant Prompt as PromptInput
  participant Submit as createPromptSubmit
  participant Server as Client/Server

  User->>NewView: select skill / change mode
  NewView-->>NewView: set selectedSkill, set mode
  NewView->>Composer: provide onModeChange, selectedSkill
  Composer->>Prompt: forward onModeChange, selectedSkill
  User->>Prompt: enter text and submit
  Prompt->>Submit: submit payload (selectedSkill, text, mode)
  alt home-skill & empty text
    Submit->>Submit: compute outgoingTextOverride = "/{homeSkill}[ trimmed text? ]", set agent="build", skip slash parsing
  end
  Submit->>Server: send followup / create session / command (as applicable)
  Server-->>Submit: ack / reply
  Submit-->>Prompt: completion result
  Prompt-->>User: render result / navigate
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related issues

  • #151: Implements the home/task-starter redesign (skill icons, metadata, NewSessionView and home submission behavior) described by the issue.
  • #181: Touches icon/skill plumbing and prompt-input changes that this PR also modifies (visual/icon updates and prompt behavior).

Possibly related PRs

  • #107: Modifies prompt-input subsystems and related prop/logic surface that overlap with this PR.

Suggested labels

P2, app

Poem

🐰 I drew tiny SVG trails so bright,

skills that gleam when you tap at night,
I nudged selection into view,
empty prompts can now start new,
hop on — a small, delightful bite.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ 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%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically references the home redesign implementation for issue #151, matching the main focus of the comprehensive two-part redesign (visual refresh and Skill starter reshape) described in the PR.
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.
Description check ✅ Passed Pull request description is comprehensive and well-structured, covering summary, spec links, detailed commit breakdown, extensive test plan with 9 manual test scenarios, coverage notes, known limitations, and out-of-scope items.

✏️ 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 feat/pr1-home-visual-refresh

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request refactors the "New Session" view by updating its layout, styling, and iconography. Key changes include the introduction of a custom SkillIcon component, updates to skill card metadata with specific icons and color classes, and the addition of a privacy reassurance message in the UI. Review feedback recommends replacing a hardcoded hex color with a standard Tailwind class for better theme consistency and moving the reassurance text outside of a conditional block to ensure it is always visible to users.

Comment thread packages/app/src/components/session/pawwork-skill-meta.ts Outdated
Comment thread packages/app/src/components/session/session-new-view.tsx
@Astro-Han Astro-Han changed the title feat(app): PR #1 home visual refresh (#151) feat(app): PR part 1 home visual refresh (#151) Apr 23, 2026
@Astro-Han Astro-Han changed the title feat(app): PR part 1 home visual refresh (#151) feat(app): home redesign per #151 Apr 23, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/app/src/components/prompt-input/submit.ts`:
- Around line 327-329: History entries currently save only currentPrompt via
input.addToHistory which drops the home-skill prefix when replaying; update the
history write so it preserves the effective outgoing text or selected skill:
when homeSkill is set (homeSkill or selectedSkill), materialize the exact
outgoing string that will be sent (e.g., the "/{homeSkill} ..." form) and pass
that to input.addToHistory instead of currentPrompt, or alternatively attach a
metadata flag (selectedSkill) to the history entry so replay logic can rehydrate
the skill; if you prefer a safe short-term change, skip calling
input.addToHistory for home-skill sends until history can round-trip the skill
state. Ensure changes touch the spot that calls input.addToHistory and the code
paths that build the outgoing payload (references: input.addToHistory,
currentPrompt, homeSkill/selectedSkill, and the send payload construction used
around lines ~415-419).

In `@packages/app/src/components/session/pawwork-skill-meta.ts`:
- Line 25: Replace the hard-coded hex tint in the homeIconClass property with
the semantic design token used by the other cards; locate the homeIconClass
field in pawwork-skill-meta.ts and change "text-[`#8b5cf6`]" to the equivalent
token class (e.g., the theme token used elsewhere such as "text-primary-500" or
the project's semantic token name) so icon tint follows the palette and theming
conventions.

In `@packages/app/src/components/session/session-new-view.tsx`:
- Around line 13-18: selectedSkill and mode are related view state but use
separate createSignal calls; replace them with a single createStore to hold both
properties (e.g., { selectedSkill, mode }) and update all usages: remove
createSignal usages for selectedSkill/mode and their setters (selectedSkill,
setSelectedSkill, mode, setMode), change toggleSkill to mutate the store
(toggling store.selectedSkill and leaving store.mode intact or updating
store.mode where needed), update the isSelected computation and the prop passed
to composer to read from the store (store.selectedSkill and store.mode), and
ensure all other reads/writes use the store's setter API so state remains
consistent and consumed together.
🪄 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: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 52808889-6489-4df8-aa0c-31b069e80e1f

📥 Commits

Reviewing files that changed from the base of the PR and between 7b40b6d and cc68528.

📒 Files selected for processing (16)
  • packages/app/e2e/sidebar/sidebar-pawwork.spec.ts
  • packages/app/src/components/prompt-input.tsx
  • packages/app/src/components/prompt-input/placeholder.ts
  • packages/app/src/components/prompt-input/submit.ts
  • packages/app/src/components/session/pawwork-skill-meta.test.ts
  • packages/app/src/components/session/pawwork-skill-meta.ts
  • packages/app/src/components/session/session-new-view-command.ts
  • packages/app/src/components/session/session-new-view-start.ts
  • packages/app/src/components/session/session-new-view.test.ts
  • packages/app/src/components/session/session-new-view.tsx
  • packages/app/src/i18n/en.ts
  • packages/app/src/i18n/zh.ts
  • packages/app/src/pages/layout/sidebar-items.tsx
  • packages/app/src/pages/session.tsx
  • packages/app/src/pages/session/composer/session-composer-region.tsx
  • packages/app/src/shell-frame-contract.test.ts
💤 Files with no reviewable changes (5)
  • packages/app/e2e/sidebar/sidebar-pawwork.spec.ts
  • packages/app/src/components/session/session-new-view-command.ts
  • packages/app/src/pages/layout/sidebar-items.tsx
  • packages/app/src/components/session/session-new-view-start.ts
  • packages/app/src/components/session/session-new-view.test.ts
📜 Review details
⏰ 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). (13)
  • GitHub Check: lint-pr-title
  • GitHub Check: smoke-macos-arm64
  • GitHub Check: unit-windows-opencode-session
  • GitHub Check: unit-windows-app
  • GitHub Check: unit-windows-opencode-server-tools
  • GitHub Check: unit-windows-opencode-config-project
  • GitHub Check: unit-windows-desktop
  • GitHub Check: typecheck
  • GitHub Check: unit-opencode
  • GitHub Check: unit-desktop
  • GitHub Check: unit-app
  • GitHub Check: e2e-artifacts
  • GitHub Check: analyze-js-ts
🧰 Additional context used
📓 Path-based instructions (1)
packages/app/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (packages/app/AGENTS.md)

Always prefer createStore over multiple createSignal calls in SolidJS

Files:

  • packages/app/src/shell-frame-contract.test.ts
  • packages/app/src/i18n/en.ts
  • packages/app/src/i18n/zh.ts
  • packages/app/src/pages/session/composer/session-composer-region.tsx
  • packages/app/src/components/session/pawwork-skill-meta.test.ts
  • packages/app/src/pages/session.tsx
  • packages/app/src/components/prompt-input/placeholder.ts
  • packages/app/src/components/prompt-input.tsx
  • packages/app/src/components/session/session-new-view.tsx
  • packages/app/src/components/prompt-input/submit.ts
  • packages/app/src/components/session/pawwork-skill-meta.ts
🧠 Learnings (10)
📚 Learning: 2026-04-22T08:49:44.563Z
Learnt from: Astro-Han
Repo: Astro-Han/pawwork PR: 126
File: packages/desktop-electron/src/main/index-sidecar-source.test.ts:3-11
Timestamp: 2026-04-22T08:49:44.563Z
Learning: In `packages/desktop-electron/src/main/index-sidecar-source.test.ts` (Astro-Han/pawwork), the test intentionally uses `expect(source).toContain` / `expect(source).not.toContain` string matching against the raw `index.ts` source text as a lightweight sidecar contract guard. The maintainer has explicitly chosen not to introduce an AST parser (e.g., `babel/parser` or acorn) for this purpose. Do not flag these string-based assertions as fragile or suggest converting them to AST-based matching.

Applied to files:

  • packages/app/src/shell-frame-contract.test.ts
  • packages/app/src/components/session/pawwork-skill-meta.test.ts
📚 Learning: 2026-04-22T05:24:42.404Z
Learnt from: Astro-Han
Repo: Astro-Han/pawwork PR: 98
File: packages/desktop-electron/src/main/menu-labels.ts:1-2
Timestamp: 2026-04-22T05:24:42.404Z
Learning: In Astro-Han/pawwork, the app i18n layer (`packages/app/src/i18n/`) only contains `en.ts` and `zh.ts`, and `normalizeLocale` (in `packages/app/src/context/language.tsx`) only returns `"en"` or `"zh"`. The desktop `MenuLocale = "en" | "zh"` union in `packages/desktop-electron/src/main/menu-labels.ts` is intentionally limited to these two locales and is not a broader restriction — do not flag it as overly restrictive or suggest adding other locales.

Applied to files:

  • packages/app/src/i18n/en.ts
  • packages/app/src/i18n/zh.ts
📚 Learning: 2026-04-20T14:36:04.099Z
Learnt from: CR
Repo: Astro-Han/pawwork PR: 0
File: packages/app/e2e/AGENTS.md:0-0
Timestamp: 2026-04-20T14:36:04.099Z
Learning: Applies to packages/app/e2e/**/*.spec.ts : Test one feature per test file

Applied to files:

  • packages/app/src/components/session/pawwork-skill-meta.test.ts
📚 Learning: 2026-04-20T14:36:04.099Z
Learnt from: CR
Repo: Astro-Han/pawwork PR: 0
File: packages/app/e2e/AGENTS.md:0-0
Timestamp: 2026-04-20T14:36:04.099Z
Learning: Applies to packages/app/e2e/**/*.spec.ts : Import test utilities from `../fixtures` instead of `playwright/test`

Applied to files:

  • packages/app/src/components/session/pawwork-skill-meta.test.ts
📚 Learning: 2026-04-22T09:32:52.535Z
Learnt from: Astro-Han
Repo: Astro-Han/pawwork PR: 126
File: packages/ui/src/theme/context.tsx:11-16
Timestamp: 2026-04-22T09:32:52.535Z
Learning: In Astro-Han/pawwork (`packages/ui/src/theme/context.tsx` and related files), the renaming of localStorage theme keys from `opencode-*` to `pawwork-*` (THEME_ID, COLOR_SCHEME, THEME_CSS_LIGHT, THEME_CSS_DARK) is intentional and should NOT include a migration path from the old keys. Migrating would re-couple PawWork and OpenCode browser storage namespaces, which the PR is explicitly designed to avoid. A reset to the PawWork default theme on upgrade is acceptable by design.

Applied to files:

  • packages/app/src/components/session/pawwork-skill-meta.test.ts
  • packages/app/src/components/session/pawwork-skill-meta.ts
📚 Learning: 2026-04-20T14:36:04.099Z
Learnt from: CR
Repo: Astro-Han/pawwork PR: 0
File: packages/app/e2e/AGENTS.md:0-0
Timestamp: 2026-04-20T14:36:04.099Z
Learning: Applies to packages/app/e2e/**/*.spec.ts : Use lowercase, descriptive test names (e.g., 'sidebar can be toggled')

Applied to files:

  • packages/app/src/components/session/pawwork-skill-meta.test.ts
📚 Learning: 2026-04-20T14:36:04.099Z
Learnt from: CR
Repo: Astro-Han/pawwork PR: 0
File: packages/app/e2e/AGENTS.md:0-0
Timestamp: 2026-04-20T14:36:04.099Z
Learning: Applies to packages/app/e2e/packages/app/src/testing/**/*.ts : Test-only hooks must be inert unless explicitly enabled and should not add normal-runtime listeners, reactive subscriptions, or per-update allocations

Applied to files:

  • packages/app/src/components/session/pawwork-skill-meta.test.ts
📚 Learning: 2026-04-20T14:36:31.017Z
Learnt from: CR
Repo: Astro-Han/pawwork PR: 0
File: packages/opencode/test/AGENTS.md:0-0
Timestamp: 2026-04-20T14:36:31.017Z
Learning: Applies to packages/opencode/test/**/*.test.{ts,tsx} : Use `testEffect(...)` from `test/lib/effect.ts` for tests that exercise Effect services or Effect-based workflows.

Applied to files:

  • packages/app/src/components/session/pawwork-skill-meta.test.ts
📚 Learning: 2026-04-20T14:36:31.017Z
Learnt from: CR
Repo: Astro-Han/pawwork PR: 0
File: packages/opencode/test/AGENTS.md:0-0
Timestamp: 2026-04-20T14:36:31.017Z
Learning: Applies to packages/opencode/test/**/*.test.{ts,tsx} : Define `const it = testEffect(...)` near the top of the test file and keep the test body inside `Effect.gen(function* () { ... })`. Yield services directly with `yield* MyService.Service` or `yield* MyTool`.

Applied to files:

  • packages/app/src/components/session/pawwork-skill-meta.test.ts
📚 Learning: 2026-04-20T14:36:04.099Z
Learnt from: CR
Repo: Astro-Han/pawwork PR: 0
File: packages/app/e2e/AGENTS.md:0-0
Timestamp: 2026-04-20T14:36:04.099Z
Learning: Applies to packages/app/e2e/**/*.spec.ts : Use `data-component`, `data-action`, or semantic roles for selectors instead of CSS class names or IDs

Applied to files:

  • packages/app/src/components/session/pawwork-skill-meta.ts
🔇 Additional comments (8)
packages/app/src/i18n/zh.ts (1)

554-564: Updated Chinese new-session copy and placeholder keys look good.

The new strings are consistent and ready for the selected-skill home placeholder flow.

packages/app/src/pages/session.tsx (1)

1961-1967: Composer context threading is correctly wired.

Home-mode context (onModeChange, selectedSkill) is passed through cleanly while keeping session-mode behavior unchanged.

Also applies to: 1983-1984, 2099-2099

packages/app/src/components/session/pawwork-skill-meta.test.ts (1)

4-21: Skill-card contract tests are well updated.

The assertions now cover both fixed ordering and required metadata fields used by current rendering paths.

packages/app/src/shell-frame-contract.test.ts (1)

41-42: Contract assertion update is appropriate for the new signature shape.

Splitting the checks keeps the guard effective while accommodating the expanded declaration.

packages/app/src/i18n/en.ts (1)

590-601: English new-session copy additions are consistent and complete.

The new keys match the skill-aware placeholder flow and read clearly.

packages/app/src/pages/session/composer/session-composer-region.tsx (1)

31-32: Mode/skill prop plumbing into PromptInput is clean and type-safe.

Optional extension is introduced at the boundary and forwarded without regressions to existing session behavior.

Also applies to: 276-277

packages/app/src/components/prompt-input/placeholder.ts (1)

12-16: Skill-specific placeholder mapping is implemented correctly.

The map is exhaustive for PawworkSkillName, and integration point in placeholder selection is placed in the right precedence order.

Also applies to: 22-22

packages/app/src/components/session/pawwork-skill-meta.ts (1)

7-17: Skill card metadata extension is solid.

The new homeIcon/homeIconClass fields are added consistently and keep card definitions straightforward.

Also applies to: 24-24

Comment thread packages/app/src/components/prompt-input/submit.ts Outdated
Comment thread packages/app/src/components/session/pawwork-skill-meta.ts Outdated
Comment thread packages/app/src/components/session/session-new-view.tsx
Remove centered Mark logo, add subtle local-processing reassurance note
below composer, tune typography and spacing to match the #151 mockup.
Also fix a latent bug where the title used text-24-medium (not defined
in packages/ui utilities); now uses text-20-medium, the largest defined
size utility.

Pure visual change — Skill card onClick behavior and zh/en card copy
unchanged.

Refs #151 (PR #1 commit 1 of 2).
Replace the three generic developer-oriented icons with mockup-faithful
custom SVGs (folder / bar-chart / pencil) tinted per Skill (warm orange
/ success green / violet) via semantic design tokens plus one arbitrary
hex for violet since no violet token exists in the design system.

Card visual switches from vertical card with description text to inline
pill (icon + title side by side, no description), matching the mockup's
light button style. Neutral chip border at rest, lifted border on hover.
Click behavior unchanged.

Home shell layout refines to match the #151 mockup: shift content down
via pt-[28vh], compact title→subtitle→pills rhythm, restore subtitle
with new copy "PawWork 可以帮你处理文件、分析信息、撰写内容并完成各类任务。"
and its English counterpart.

The upstream Icon component is kept in sidebar-items.tsx for the skill
badge (falls back to folder / status / pencil-line), so badge icons
differ from home for data-analysis during the PR #1 → PR #2 interval;
PR #2 removes the badge entirely.

Refs #151 (PR #1 commit 2 of 2).
Clicking a Skill card now sets a local selectedSkill signal inside
NewSessionView; it no longer calls session.create or navigate. The
composer placeholder switches to a Skill-specific copy via a new
branch in promptPlaceholder.

NewSessionView's composer prop is now a render-prop that receives a
ctx of { onModeChange, selectedSkill }. Ctx threads through
renderComposerRegion to SessionComposerRegion to PromptInput.
PromptInput derives the Skill placeholder from ctx directly; upstream
does not compute placeholder strings.

No preparation card: pill selected state + placeholder switch already
cover the feedback that a Skill is selected, and dropping the card
keeps the composer position stable through selection changes.

session-new-view.test.ts still exercises startPawworkSkillSession as a
standalone function (unchanged here); its assertions stay green. The
eventual rewrite lands in the cleanup commits. shell-frame-contract
test updated for the new renderComposerRegion signature.

Part of PawWork issue 151 Skill starter reshape.
In home mode, wrap the DockTray agent Select in a Show guard so it does
not render. Model selector, variant, WorkspaceChip, attachment, and Send
stay. Keyboard shortcuts (agent.cycle, mode.shell, mode.normal) still
work because only the visible chip is hidden; the underlying state is
untouched. Session composer is unchanged.

Plan referenced explicit shell/prompt-mode toggle buttons; the current
code exposes those only through command-palette entries + keybinds, so
there is nothing extra to hide.

Part of PawWork issue 151 Skill starter reshape.
Drop the session.skill badge rendering from sidebar-items. The
session.skill field on Session stays readable for legacy data
compatibility; the sidebar simply does not render it anymore. Removes
the getPawworkSkillMeta import, the skill createMemo, and the now-unused
language binding on SessionItemContent so the subsequent cleanup commit
can delete the getPawworkSkillMeta export without touching the sidebar
again.

Part of PawWork issue 151 Skill starter reshape.
For home sends (params.id undefined) the model/agent required guard no
longer fails when currentAgent is missing, and the effective agent
variable is forced to "build" regardless of the persisted global agent.
This applies to every home submission including typed custom slash
commands and shell; session sends keep requiring an agent and pass it
through verbatim. Global agent state is never mutated.

isNewSession was already computed below the guard; moved its assignment
above so the guard and the agent override share the same binding.

Part of PawWork issue 151 Skill starter reshape.
Thread selectedSkill from NewSessionView through SessionComposerRegion
and PromptInput into createPromptSubmit. Home submit with a selected
Skill now:

- allows empty-text send (Gate 1 on both server-side guard and the Send
  button disabled expression; the Enter-key path falls through to the
  relaxed server guard and needs no separate edit)
- overrides outgoing text to "/skill-name ..." or "/skill-name" (Gate 4)
- routes through promptAsync, never session.command (Gate 5; the single
  outgoingTextOverride field also suppresses sendFollowupDraft's slash
  detection, so no second flag is needed)
- skips prompt history entry when the user's text is empty (Gate 6)

Same outgoing text feeds both requestParts and optimisticParts so the
user's own message bubble shows the slash-prefixed text, per spec. The
editor state is never mutated; selectedSkill is local to NewSessionView
and survives submit, so no restore callback is needed.

Part of PawWork issue 151 Skill starter reshape.
Drop the now-unreferenced helpers, export, and tests left over from the
pre-reshape Skill starter:

- session-new-view-start.ts and session-new-view-command.ts (the old
  click-starts-session helpers; no callers after UI-3)
- e2e/sidebar/sidebar-pawwork.spec.ts (covered the badge removed in
  UI-5)
- getPawworkSkillMeta export from pawwork-skill-meta.ts (UI-5 removed
  the sidebar caller, UI-3 removed the home caller when the
  preparation card was dropped)
- session-new-view.test.ts (covered the deleted startPawworkSkillSession
  flow; the new createPromptSubmit Skill-aware path is exercised
  manually per the PR checklist and will get unit coverage in a
  follow-up PR)

pawwork-skill-meta.test.ts trimmed to a card-identity snapshot.

Combining the file deletion and the test trim into one commit avoids
a broken intermediate typecheck (tsgo -b compiles test files, so
dropping the export with the test still referencing it would fail the
gate).

Part of PawWork issue 151 Skill starter reshape.
In home mode, hide the top DockTray entirely and surface the model and
variant chips on the bottom bar immediately left of the Send button.
Session mode keeps the original tray (agent + model + variant up top,
only Send at the bottom).

Extract the model and variant chip JSX into two local renderers inside
PromptInput so home and session share one source of truth; home passes
the bottom-button motion memo as the chip trigger style, session keeps
the existing top-tray control style.

Also raises the composer scroll area min-height to 104px so the editor
does not feel cramped when empty.

Part of PawWork issue 151 Skill starter reshape.
Extract the outgoingTextOverride string assembly into a pure
buildHomeOverride helper and wire submit.ts's draft construction to
use it, so the (skill, user-text) -> "/skill …" contract can be
unit-tested without touching the full context-tree harness. Covers:

- no selected Skill returns undefined
- Skill-only send returns "/skill-name"
- whitespace-only user text is treated as empty
- Skill + user text trims and joins with a single space
- slash-like user text is kept verbatim; Gate 5's routing-bypass is
  the caller's job, not this helper's

Also extend placeholder.test.ts with the Skill branch introduced in
UI-3 plus its priority ordering (shell > comments > selectedSkill >
suggest > simple > normal).

This does not replace a full createPromptSubmit integration harness;
Gate 5 (slash bypass) and Gate 6 (history skip) are inline in
handleSubmit and remain covered by manual verification. A follow-up
PR can extract further pure helpers or build an SDK-mock harness.

Part of PawWork issue 151 Skill starter reshape.
@coderabbitai coderabbitai Bot mentioned this pull request Jun 1, 2026
13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request P1 High priority ui Design system and user interface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant