Skip to content

refactor(desktop): colocate hook/component families into scoped folders - #55493

Merged
OutThisLife merged 1 commit into
mainfrom
bb/desktop-hook-folders
Jun 30, 2026
Merged

OutThisLife merged 1 commit into
mainfrom
bb/desktop-hook-folders

Conversation

@OutThisLife

Copy link
Copy Markdown
Contributor

Summary

Apply the repo's own feature-folder convention to the few single-scoped families that were still sitting flat in shared/grab-bag dirs. Each family folds into its own folder with index as the export — directory resolution keeps the public import path identical for external consumers — and the now-redundant filename prefix is dropped.

Folded

  • session/hooks/use-prompt-actions.ts (+ -utils, + tests) → use-prompt-actions/{index,utils}.ts (a -utils helper was living in the shared hooks/ dir next to unrelated hooks).
  • components/assistant-ui/ thread render family → assistant-ui/thread/ (index, content, status, message-parts, timestamp, types, list, timeline, timeline-data, assistant-message, system-message, user-message, user-edit-composer, user-message-text + tests).
  • components/assistant-ui/ tool family → assistant-ui/tool/ (fallback, fallback-model, approval + tests).

Deliberately left flat

  • App-wide shared primitives in assistant-ui/: markdown-text, directive-text, tooltip-icon-button, clarify-tool, ansi-text, message-render-boundary — not thread/tool-scoped.
  • app/desktop-controller.tsx — a route root with ~80 relative imports; foldering would churn all of them for no real gain, and app/ is its correct home.
  • lib/, store/, components/ui/ — collections of independent modules, not families.

Notes

  • Pure restructuring — no behaviour change. git mv + mechanical import-specifier rewrites; Thread etc. still import from @/components/assistant-ui/thread (resolves to thread/index).

Test plan

  • npm run typecheck — 0 errors
  • eslint on changed dirs — clean
  • Pure-logic tests for moved modules pass (thread content/timestamp/timeline-data, tool/fallback-model schema bits, use-prompt-actions/utils)
  • Note: the <Thread>-render tests (block-direction, streaming, user-message-edit) and two tool/fallback-model URL-ellipsis assertions fail identically on unmodified main in this local env (jsdom lacks CSS.escape; CI provides it) — not introduced here.

Single-scoped helpers/sub-files were sitting flat in shared/grab-bag dirs.
Fold each family into its own folder (index = the export, dir resolution keeps
public import paths intact), dropping the now-redundant filename prefix:

- session/hooks/use-prompt-actions.ts (+ -utils, + tests)
  -> use-prompt-actions/{index,utils}.ts (+ tests)
- components/assistant-ui/thread* + assistant/system/user message renderers
  -> assistant-ui/thread/{index,content,status,message-parts,timestamp,types,
     list,timeline,timeline-data,assistant-message,system-message,user-message,
     user-edit-composer,user-message-text} (+ tests)
- components/assistant-ui/tool-fallback(+model)/tool-approval
  -> assistant-ui/tool/{fallback,fallback-model,approval} (+ tests)

Pure move + import rewrites; no behaviour change. App-wide shared primitives
(markdown-text, directive-text, tooltip-icon-button, clarify-tool, ansi-text,
message-render-boundary) stay flat. desktop-controller intentionally left in
app/ (route root; foldering would churn ~80 relative imports for no gain).
@OutThisLife
OutThisLife merged commit 6763d63 into main Jun 30, 2026
20 checks passed
@OutThisLife
OutThisLife deleted the bb/desktop-hook-folders branch June 30, 2026 07:45
waefrebeorn pushed a commit to waefrebeorn/slermes that referenced this pull request Jul 2, 2026
…ok-folders

refactor(desktop): colocate hook/component families into scoped folders
habarmc1223-sudo pushed a commit to habarmc1223-sudo/hermes-agent-fluxmem that referenced this pull request Jul 8, 2026
…ok-folders

refactor(desktop): colocate hook/component families into scoped folders
santhreal pushed a commit to santhreal/hermes-agent that referenced this pull request Jul 13, 2026
…ok-folders

refactor(desktop): colocate hook/component families into scoped folders
Gravezzz pushed a commit to Gravezzz/hermes-agent that referenced this pull request Jul 21, 2026
…ok-folders

refactor(desktop): colocate hook/component families into scoped folders
leewenjie pushed a commit to leewenjie/hermes-agent that referenced this pull request Aug 7, 2026
…ok-folders

refactor(desktop): colocate hook/component families into scoped folders
melon-xf added a commit to melon-xf/hermes-agent that referenced this pull request Sep 3, 2026
…ok-folders

refactor(desktop): colocate hook/component families into scoped folders
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.

1 participant