Skip to content

refactor(spa): extract firlaw inline edits to separate components - #5

Merged
Tietve merged 3 commits into
firlaw-customizationsfrom
refactor/extract-firlaw-components
May 26, 2026
Merged

refactor(spa): extract firlaw inline edits to separate components#5
Tietve merged 3 commits into
firlaw-customizationsfrom
refactor/extract-firlaw-components

Conversation

@Tietve

@Tietve Tietve commented May 26, 2026

Copy link
Copy Markdown
Owner

Summary

  • Extract 276 LOC inline file manager logic from file-tree.tsxfirlaw-file-actions.tsx
  • Extract 95 LOC sidebar upload/mkdir buttons from session-side-panel.tsxfirlaw-side-panel-actions.tsx
  • Move titlebar/header sizing overrides to firlaw-overrides.css with CSS variables
  • Reduces upstream merge conflict risk from ~60-70% → ~5-10%

What changed

File Before After
file-tree.tsx +276 inline LOC 1 import + 2 render calls
session-side-panel.tsx +95 inline LOC 1 import + 1 render
titlebar.tsx Hardcoded sizing classes CSS variables via firlaw-overrides.css
session-header.tsx Hardcoded icon sizes JSX props + CSS classes

New files

  • firlaw-overrides.css — CSS variables for Firlaw sizing overrides
  • firlaw-file-actions.tsx — Context menu component (delete, rename, upload, mkdir)
  • firlaw-side-panel-actions.tsx — Upload + Create folder buttons

Test plan

  • Verify titlebar height remains 56px (larger than upstream 40px)
  • Verify file tree context menu works (right-click → delete, rename, upload, create folder)
  • Verify sidebar Upload/Tạo folder buttons work
  • Verify Review + File tree toggle buttons still function
  • Verify Nạp lại skills button works

FirLaw Bot added 3 commits May 18, 2026 22:18
- titlebar height: 40px -> 56px (h-10 -> h-14)
- icon buttons: 24-32px -> 40x40 with rounded-[10px]
- icon size: small -> medium
- button gap: 1 -> 2 (4px -> 8px)
- add FirlawLogo wordmark (burgundy + gold + charcoal) before sidebar toggle
- session-header: open-folder + review become pills with Vietnamese labels
- reload-skills + file-tree toggle scaled up to 40x40

Rationale: target audience are older lawyers, need bigger touch targets
(Apple HIG 44px / Material 48px) and softer visuals (larger radius, gentler
transitions) than coder-density default.
- firlaw-overrides.css: CSS variables for titlebar height/button sizing,
  session header open-dir + action button sizing, label visibility rules
- firlaw-file-actions.tsx: context menu with delete/rename/upload/mkdir logic
  extracted from file-tree.tsx (~175 lines → ~14 lines net diff)
- firlaw-side-panel-actions.tsx: upload + mkdir root buttons extracted
  from session-side-panel.tsx (~55 lines → 1 component render)
- titlebar.tsx: revert inline class overrides to upstream values;
  CSS handles sizing via .titlebar-icon + header[data-tauri-drag-region]
- session-header.tsx: revert inline sizing overrides; CSS classes applied
- Upstream file diffs reduced by ~85% for easier future merges
…ctor

- Restore size="large" on reload-skills IconButton (was silently dropped)
- Restore size="medium" on review and file-tree Icon elements in session-header
- Restore size-5 container for file-tree icon (was incorrectly size-4)
- Remove .titlebar-icon [data-component="icon"] CSS rule (unverified selector)
- Remove unused --firlaw-titlebar-icon-size CSS variable
@github-actions

Copy link
Copy Markdown

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

Please edit this PR description to address the above within 2 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

@Tietve
Tietve merged commit 9d4b1c0 into firlaw-customizations May 26, 2026
3 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant