generated from t3-oss/create-t3-turbo
-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Navigation/Breadcrumbs in filerunner, pull Nav into a component #92
Open
bdsqqq
wants to merge
78
commits into
main
Choose a base branch
from
igor/navigation-in-filerunner
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 61 commits
Commits
Show all changes
78 commits
Select commit
Hold shift + click to select a range
5204871
add breadcrumbs and open file button to filerunner
bdsqqq cc0c32f
remove px to align with content in filebrowser
bdsqqq a5f32a6
extract Nav/breadcrumbs into a component, we can name this better later
bdsqqq 2bcacb1
expose `actions` from breadcrumbs (buttons in the right)
bdsqqq dd8f73a
use breadcrumbs component (still need to refactor filebrowser's menu …
bdsqqq e52655c
experimenting with Split button in filerunner
bdsqqq 2168258
added a TODO, need to validate this with mark or theo
bdsqqq 9146f84
a React.ReactNode shouldn't be inside a template literal
bdsqqq 9814c7f
solves TS warnings, there's probably a better way to do it
bdsqqq b46f872
put form & submit button in a div to prevent unwanted dividers
bdsqqq c8452d1
allow splitButton as actionItem
bdsqqq e761d68
use Nav actions to render `open file` split button
bdsqqq bd1b353
run hook button in Nav actions
bdsqqq a6ec460
add missing prop
bdsqqq 7a63679
unused import sorry
bdsqqq fc81751
add button from ping + used it in an implementation of splitButton
bdsqqq 2f0062b
replace ping button styles with styles from captain
bdsqqq 4fd7cfe
a bit more styling in the splitdropdown button, still a bit more to go
bdsqqq 5abbdb0
Update button styling, add variants, export type for `ListItemWithIco…
bdsqqq 409122f
Igor/nav in filerunner (#97)
bdsqqq 973008d
Igor/scared of fucking up main (#98)
bdsqqq 9f2c2fc
buttons inside dropdowns look weird with shadows, made shadows the de…
bdsqqq 3d8f832
changing this in 2 places was kind of annoying, pulled it to a component
bdsqqq c01368a
uhhhh, that component exploded everything for some reason, copy pasti…
bdsqqq 2addfd9
w -> min-w to prevent children overflowing weirdly
bdsqqq f27f6e5
removing this span makes the button height not break for some reason??
bdsqqq c5f9302
consume icons correctly, a bit of styling
bdsqqq ebbcf6b
breadcrumb button types extend actual Button types
bdsqqq daa885c
filebrowser provide icon to breadcrumbs actions correctly
bdsqqq 5b550d6
remove unused draft of spltbutton
bdsqqq 4c5977b
rename SplitButtonDropdown to something not silly
bdsqqq 43306b2
update prop type to include icons
bdsqqq 06b8c3d
fix mismatched icon types
bdsqqq 50cfa93
add Igor todo
bdsqqq 7b547e5
add disabled styles to primary button
bdsqqq 086fdb5
horizontally align filerruner to filebrwoser content
bdsqqq af4c00d
adding this span back, no consequences since were consuming icons pro…
bdsqqq 03d9a0d
base size for icon buttons being h-4 prevents annoying shift caused b…
bdsqqq c7b2645
take hover style from three dots menu in App
bdsqqq e0a837f
remove arbitrary stuff I was too tired to make nice, actually made it…
bdsqqq 78334f4
add slight bg change on button hover
bdsqqq e4b5c28
hover/focus tweaks
markflorkowski e0de972
Merge branch 'igor/navigation-in-filerunner' of https://github.com/pi…
markflorkowski 7f6d3e6
fixed-height buttons, remove dividers on file browser
markflorkowski 53faba4
remove unused imports
markflorkowski 4b1a976
add wells to file browser
markflorkowski 9177f5e
fix mismatched icon types
bdsqqq c323bf2
start <App /> NavMenu migration to ButtonDropdown Component
bdsqqq 5fd8c9c
support ButtonLinks in dropdowns
bdsqqq dd93cfa
types and back compat for Links vs Buttons in dropdowns
bdsqqq 22e1d46
explicitelly use links on the App NavMenu dropdown
bdsqqq 12b185c
"finish" <App /> NavMenu migration to ButtonDropdown Component
bdsqqq f25817c
prevent clipping of actions with long names
bdsqqq 02a6db8
Merge branch 'main' into igor/navigation-in-filerunner
markflorkowski 79a244f
Merge branch 'main' into igor/navigation-in-filerunner
markflorkowski ad7fc82
some fixes
markflorkowski bfa0416
more fixes
markflorkowski 75cfbeb
commetns
markflorkowski 3d04b51
more fixes
markflorkowski 30a8843
openFile
markflorkowski a03ae02
update warning message
markflorkowski 38da977
removed disabled from ButtonStyle, apply disabled style based on aria…
bdsqqq e929b9b
a tags don't have a 'disabled' attribute
bdsqqq d1ef3ca
add TODO
bdsqqq 663321e
make ovewritting tailwind classes not suck
bdsqqq 8c31488
not having a span with no way to pass classes to makes styling this e…
bdsqqq f1b653c
actually use buttom component in filebrowser folders section
bdsqqq 6cfb92a
add indigo button variant color
bdsqqq ea55111
button was missing `disabled` prop
bdsqqq a3a0d79
indigo disabled classes -> aria-disabled
bdsqqq 1e2f247
`Save Changes` button uses an actual <Button />
bdsqqq edf09d2
add cursor-not-allowed when button is disabled
bdsqqq 4847b96
file-form-modal button -> <Button />
bdsqqq 99dd830
filebrowser buttons -> <Button />
bdsqqq 3a93d35
folder-form-modal buttons -> <Button />
bdsqqq 003a488
white button doesn't turn gray on hover, add transition to buttons
bdsqqq 1f88cd4
center empty state vertically; max-w and center text
bdsqqq b4e77a3
fix: only center empty states, otherwise breaks hooks list
bdsqqq File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import childProcess from "child_process"; | ||
import { promisify } from "util"; | ||
import os from "os"; | ||
import fs from "fs/promises"; | ||
import path from "path"; | ||
|
||
import logger from "@captain/logger"; | ||
|
||
const promisifiedExecFile = promisify(childProcess.execFile); | ||
|
||
const getCommand = () => { | ||
const plat = os | ||
.platform() | ||
.toLowerCase() | ||
.replace(/[0-9]/g, ``) | ||
.replace(`darwin`, `macos`); | ||
|
||
if (plat === "win") return "start"; | ||
if (plat === "linux") return "xdg-open"; | ||
if (plat === "macos") return "open"; | ||
|
||
throw new Error("Idk what os this is"); | ||
}; | ||
|
||
const pathExists = async (path: string) => { | ||
try { | ||
await fs.access(path); | ||
return true; | ||
} catch { | ||
return false; | ||
} | ||
}; | ||
|
||
const writeFile = async (filePath: string, data: string) => { | ||
try { | ||
const dirname = path.dirname(filePath); | ||
const exist = await pathExists(dirname); | ||
if (!exist) { | ||
await fs.mkdir(dirname, { recursive: true }); | ||
} | ||
|
||
await fs.writeFile(filePath, data, "utf8"); | ||
} catch (err) { | ||
throw err; | ||
} | ||
}; | ||
|
||
export async function openFile(path: string) { | ||
const exists = await pathExists(path); | ||
const maybeFileName = path.split("/").pop(); | ||
|
||
// create file if it doesn't exist | ||
if (!exists) { | ||
logger.warn(`${maybeFileName ?? "file"} does not exist, creating it now!`); | ||
await writeFile(path, "{}"); | ||
} | ||
|
||
return await promisifiedExecFile(getCommand(), [path]); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@t3dotgg Please test on windows. I think
start
should open the default program for a file, but internet could be lying.