fix: complete file picker dialog action (#2483)

huaiyuWangh created

- Add DialogID field to file picker command in commands.go
- Add FilePickerID case handler in openDialog function
- Remove TODO comment and complete implementation

Change summary

internal/ui/dialog/commands.go | 2 +-
internal/ui/model/ui.go        | 4 ++++
2 files changed, 5 insertions(+), 1 deletion(-)

Detailed changes

internal/ui/dialog/commands.go 🔗

@@ -464,7 +464,7 @@ func (c *Commands) defaultCommands() []*CommandItem {
 		model := cfgPrime.GetModelByType(agentCfg.Model)
 		if model != nil && model.SupportsImages {
 			commands = append(commands, NewCommandItem(c.com.Styles, "file_picker", "Open File Picker", "ctrl+f", ActionOpenDialog{
-				// TODO: Pass in the file picker dialog id
+				DialogID: FilePickerID,
 			}))
 		}
 	}

internal/ui/model/ui.go 🔗

@@ -2949,6 +2949,10 @@ func (m *UI) openDialog(id string) tea.Cmd {
 		if cmd := m.openReasoningDialog(); cmd != nil {
 			cmds = append(cmds, cmd)
 		}
+	case dialog.FilePickerID:
+		if cmd := m.openFilesDialog(); cmd != nil {
+			cmds = append(cmds, cmd)
+		}
 	case dialog.QuitID:
 		if cmd := m.openQuitDialog(); cmd != nil {
 			cmds = append(cmds, cmd)